Professional Documents
Culture Documents
ARM-Instruction Set - 2 & Pipelining: M3: Embedded Architectures - 1: RISC Architecture - ARM
ARM-Instruction Set - 2 & Pipelining: M3: Embedded Architectures - 1: RISC Architecture - ARM
ARM-Instruction Set - 2 & Pipelining: M3: Embedded Architectures - 1: RISC Architecture - ARM
& Pipelining
M3: Embedded Architectures- 1: RISC Architecture - ARM
Addressing Modes
• Mode 1: Shifter operands for data processing inst
• Mode 2: Load/Store word/unsigned byte
• Mode3: Load/Store half-word/signed byte
Meetha.V.shenoy
2
x = (a+b)-c;
ADR r4,a
LDR r0,[r4]
ADR r4,b
Meetha.V.shenoy
ADR r4,x
STR r3,[r4]
3
31-28 27 26 25 24 23 22 21 20 19-16 15-0
Examples
LDMIA R0, {R5 - R8}
Meetha.V.shenoy
4
0x204 20304050
0x200 21314151
0x1fc
0x1fc 22324252
22324252
0x1f8 23334353
0x1f8 23334353
0x1f4 24344454
0x1f4
0x1f0 25354555
Meetha.V.shenoy
0x1e0 Empty
Stack Fully Descending
Descending
5
0x204
0x200
0x1fc
0x1fc
0x1f8
0x1f8
0x1f4
0x1f4
0x1f0 24344454
0x1f0
Meetha.V.shenoy
6
Branch instructions
conditional branch forwards /backwards up to 32MB
branch /jump can also be generated by writing a value to R15
31-28 27 26 25 24 23-0
Meetha.V.shenoy
MOV PC, LR
LDR PC, #func
7
Pipeline in ARM
• 3 stages of pipeline
• Fetch-Decode-Execute
• Normal Instruction require three clock cycles – inst exec
Meetha.V.shenoy
8
add r0,r1,r2 fetch decode execute
sub r2,r3,r6 fetch decode execute
cmp r2,r4 fetch decode execute
Data stall
Meetha.V.shenoy
11
bne nxt fetch decode execute
nop fetch decode execute
nop
fetch decode execute
sub r2,r3,r6
-----
Delayed Branching
Meetha.V.shenoy
12