Professional Documents
Culture Documents
6.ARM Addressing Modes
6.ARM Addressing Modes
14 0 1 13 0 0 4 8 217
ADDRESSING MODES
There are different ways to specify the address of the operands
for any given operations (load, add or branch)
2. Register Addressing
Operand is a register
ADD r2, r0, r1
5. Immediate offset
Constant address is added to a base register
LDR r2, [r0, #8]
6. Register Offset
Another register is added to the base register
Array index is in one register and base of the array is in another
LDR r2, [r0, r1]
ADDRESSING MODES (3)
7. Scaled Register Offset
Allows the register to be shifted before it is added to the base register
Useful to turn array index in to a byte address by shifting it left by 2
bits
LDR r2, [r0, r1, LSL #2]