Professional Documents
Culture Documents
ADDRESSING MODES
Outline
• Privilege Modes:
1. Privileged mode: can access all resources
2. Unprivileged (user) mode: prohibited from
accessing certain memory regions and from
executing some operations
• Operation States:
1. Debug State: when the processor is halted by a
breakpoint
2. Thumb State: Normal operation (Thumb refers to
the name of the instruction set – ARM Cortex
specific)
ARM Processor Programmers’ Model
• Operation Modes:
1. Handler Mode: when executing an exception
handler, e.g. Interrupt Service Routine (ISR)
2. Thread Mode: when executing normal application
code
ARM Cortex–M3 / Cortex-M4 Registers
ARM Cortex–M3 / Cortex-M4 Registers
e
ng
ra
s
es
dr
ad
b
17
Addressing Modes
The address contains the address of the data in memory indirect addressing
Addressing Modes
sp sp
sp sp
Data2 Data2 Data3
sp
Data1 Data1 Data1 Data1
Data Data Data Data Data
Data Data Data Data Data
Data Data Data Data Data
Initial state Push Data1 Push Data2 Pop Data2 Push Data3
MEMORY ACCESS
INSTRUCTIONS IN ARM
Addressing Modes
ARM Cortex-M3, Cortex-M4
Moving Data within ARM Processor
Immediate Addressing
Memory Access Instructions - ARM
Signed load instructions automatically perform sign expansion from smaller size
e.g. ldrsb 0x85 will write 0xffffff85 in the destination register
Memory Access Instructions - ARM