ARM 2 Flashcards
what are addressing modes
various formats of specifying the operands in instructions
what are the various addressing modes
1.Immediate (data specified)
MOV R5, #0x20
2.Register (all logical and arithmetic instr based on this mode only in ARM)
MOV R5, R1
3.Direct (address of operand is given)
this address will be 12 bits offset from PC given by assembler
LDR R5, Variable
STR R5, Variable
4. Indirect addressing mode
address of operand is given by register
LDR, R5, [R1]
5. Register Relative Indirect Addressing mode
address of memory register + numeric value
LDR R0, [R1,#0x04]
LDR R0, [R1,#0x04]!
pre index addressing
LDR R0, [R1],#0x04
post index addressing
6. Base Indexed Indirect addressing mode
address- sum of two registers
first reg - base, second reg -index
LDR R0,[R1,R2]
LDR R0,[R1,R2]!
PRE INDEX ADDRESSING
LDR R0,[R1],R2
7. Base with scaled index indirect addressing mode
LDR R0, [R1, R2, LSL #2]
R0 - data from memory pointed by (R1+R2 shifted left by 2 bits)
ARM instruction set
- Data processing
- Branch
- Load and store
- SWI (Software interrupt) instr
- program status register instr
what does barrel shifter mean
enables shifting 32 bit operand in one of the source registers left or right by specific no of positions within the cycle time of instr
mov r7,r5,LSL#2
what is SWP used for?
swap a word between memory and register
what is SWPB used for?
swap a byte between memory and register