Expansion of inline assembler instructions
that use constants
The constant in an instruction with a constant operand is
not limited to the values permitted by the instruction. Instead,
the compiler translates the instruction into a sequence of instructions with
the same effect. For example:
ADD r0,r0,#1023
might be translated into:
ADD r0,r0,#1024 SUB r0,r0,#1
Another example of expansion possibility is:
MOV rn,0x12345678
With the exception of coprocessor instructions, all ARM instructions
with a constant operand support instruction expansion. In addition,
the MUL instruction can be expanded into a sequence of
adds and shifts when the third operand is a constant.
The effect of updating the CPSR by an expanded
instruction is:
arithmetic instructions
set the NZCV flags correctly
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.