Memory and Addressing Modes Flashcards
what is the effective address
the address accessed by LDR or STR
Synatx for Immediate offset addressing
[Rn, #offset]
example of immediate offset addressing
LDR R0, [R1, #4]
LDR R0, [R1, #0]
Does immediate offset addressing change the value in the base register Rn
no
Syntax for register offset addressing
[Rn, Rm]
exmaple of register offset addressing
LDR R0, [R1, R2]
Advantage of register offset addressing
offset can be changed as program executes
does register offset addressing change the value in the base register
no
Syntax for scaled register offset
[Rn, Rm, LSL #2}
example of scaled register offset
LDR R0, [R1, R2, LSL #2}
When might scaled register offset be used
when offset is always 4x the count
in waht order does post index addressing work
- computes effecrive address and accesses memory
2. increments/decrements
example of post indexed addressing
LDR R4, [R1], #4
in what order does pre indexed addressing work
- increment/decrement
2. compute effective address and access memory
example of pre indexed addressing
LDR R4, [R1, #4]!