How to load the number 0xEFFFFFF2
to a register in ARM.
What will be the rot in this?
MVN r0, #2D1
Is this instruction valid?
How to load the number 0xEFFFFFF2
to a register in ARM.
What will be the rot in this?
MVN r0, #2D1
Is this instruction valid?
mvn is just going to invert 0x2D1 to 0xFFFFFD2E right? You need the inverse of your desired number which is 0x1000000D right? Gnu assembler is encoding 0x2D1 the 2 means rotate right 4 and the 0xD1 is the value to rotate. you dont need to worry about that unless you are making the machine code yourself you dont need to put the 0x2D1 in the assembly language put the number you want either do this
mov r0,#0xEFFFFFF2
or
mvn r0,#0x1000000D
or
ldr r0,=0xEFFFFFF2
An assembler like gnu assembler will attempt to find a single instruction that will solve the mov in this case it chooses mvn r0,#0x1000000D, some other assemblers may not try and simply tell you your constant is bad for the mov instruction forcing you to do the mvn yourself. Or you can do the mvn yourself. For gnu assembler the third choice it will try mov, mvn, and if neither work for that constant then it will place the value nearby and do a pc relative load (consuming two words of .text space).