Thumb Instructions
Thumb Instructions
Thumb Instructions
1 of 37
Objectives
2 of 37
CPU Instruction Set
3 of 37
Processor Operating States
ARM state
which executes 32-bit, word-aligned ARM instructions.
THUMB state
which operates with 16-bit, halfword-aligned THUMB
instructions.
4 of 37
Thumb Instruction Set
5 of 37
Thumb Instruction Set
6 of 37
Thumb Instruction Set
7 of 37
Thumb applications
Note:
Switching between ARM and Thumb States of Execution
Using BX Instruction
8 of 37
Thumb applications
9 of 37
DATA TYPES
Byte (8-bit):
placed on any byte boundary.
Half-word (16-bit):
aligned to two-byte boundaries.
Word (32-bit):
aligned to four- byte boundaries.
10 of 37
Features
11 of 37
ARM7TDMI core
12 of 37
Mode Switching
13 of 37
Thumb Programmers Model
14 of 37
THUMB Register Organisation
Thumb General registers and Program Counter
LR LR_ FIQ LR_ SVC LR_ ABT LR_ IRQ LR_ UND
PC PC_ FIQ PC_ SVC PC_ ABT PC_ IRQ PC_ UND
sprsr_fiq
SPSR_FIQ SPSR_SVC SPSR_ABT sprsr_fiq
SPSR_IRQ SPSR _UND
sprsr_fiq
15 of 37
ARM-Thumb Similarities
Load-store architecture
Support 8-bit byte, 16-bit half-word and 32 bit word data types
with aligned boundaries
32 bit unsegmented memory.
16 of 37
ARM-Thumb differences
17 of 37
Thumb exception
18 of 37
Thumb Branching
19 of 37
Branch Instruction Formats
B <cond> <label>
15 14 13 12 11 8 7 0
B <label>
1 1 1 0 0 11 Bit Offset
BL <label>
1 1 1 H 11 Bit Offset
BX Rm
0 1 0 0 0 1 1 1 0 H Rm 0 0 0
20 of 37
Features
21 of 37
BL Instruction
2. H = 11
PC := LR + (offset shifted left 1 place)
22 of 37
Software Interrupt Instruction
1 1 0 1 1 1 1 1 8 Bit Immediate
23 of 37
Data Processing
24 of 37
Instruction formats
25 of 37
Instructions
26 of 37
Instruction
27 of 37
Instruction
28 of 37
Instruction
AND Rd, Rm
EOR Rd, Rm
ORR Rd, Rm
BIC Rd, Rm
MUL Rd, Rm
29 of 37
Instruction (using Hi registers)
30 of 37
Data Transfer Instruction
31 of 37
Multiple register transfers
32 of 37
Stack Mode
33 of 37
Thumb-ARM Decompression
34 of 37
Properties
35 of 37
Summary
36 of 37
Thank You, Any Questions ?
37 of 37