Syntax: LDR (or STR) <destination>, [<base>],<offset>
This form of addressing is very similar to pre-indexed addressing. In this case the offset field is not optional.
Examples:
LDR R1,[R0],R7 ; Load R1 from address R0 : R0=R0+R7
STR R6,[R7],#4 ; Store R6 at address R7 : R7=R7+4
LDR R8,[R2],R5,LSL#4 ; Load R8 from address R2 : R2=R2+R5*16
STR R0,[R0],#20 ; Store R0 at address R0 : R0=R0+20
When post-indexed addressing is used, the contents of the base register alone are taken as the address of the memory word to be accessed. Only after this word has been accessed are the contents of the offset field added to the base register. Obviously, this implies that write back always occurs, so we do not need to specify it.
|
|
|