Immediate Pre-indexed (AM
2)[basereg, #+/-value]!
where:
|
basereg |
Specifies a register containing the base address. |
|
value |
Specifies the 12-bit immediate offset used with the value of basereg to form the address. |
|
! |
Sets the W bit, which updates the base register. |
if U == 1 then
addr
= basereg + value
else/* if U == 0 */
addr
= basereg - value
If ConditionPassed (condition) then
basereg
= addr
The value of the immediate offset is added to or subtracted from the value of the base register basereg . It is written back to the base register basereg if the condition specified in the instruction matches the condition code status.
This addressing mode is useful for pointer access to arrays with automatic update of the pointer value.
|
31 |
|
|
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
|
|
16 |
|
condition |
0 |
1 |
0 |
1 |
U |
B |
1 |
L |
basereg |
||||||
|
15 |
|
|
12 |
11 |
|
|
|
|
|
|
|
|
|
|
0 |
|
dest |
value |
||||||||||||||
The B bit indicates an unsigned byte ( B == 1 ) or a word access ( B == 0 ).
The L bit indicates a Load ( L == 1 ) or a Store ( L == 0 ) instruction.
NoteThe syntax [basereg] must not be treated as an abbreviation for [basereg, #0]! .
CautionLDR R6, [R4, #-17]!