We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
How to load the two’s complement representation of -1 into Register 3 using one instruction?
i am working on ARM7 and NXP processor.
If you use MOV the assembler will try various tricks to see if it can be done using shifting or using MVN
MOV r3, #-1
the assembler will turn this into
MVN r3, #0
which you can also write.
See the armasm documentation about loading literals, one can also use LDR r3,=-1 which will load the value from a literal pool if it can't be done in one instruction inline.
Using MOV32 r3,-1 will generate two instructions
that will help me. thanks..