THUMB MODE 
Varun K 
144520 
Nitw 
ARM
CISC Vs RISC 
• CISC 
• complete a task in as few lines of assembly 
• MULT 2:3, 5:2;; "complex instruction.“ 
• "a = a * b“ 
• Advantage:compiler has to do very little work, 
very little RAM is required to store instructions
ARCHITECTURE
CISC Vs RISC 
• RISC 
• RISC processors only use simple instructions that can be 
executed within one clock cycle. 
• LOAD; PROD; STORE. 
• LOAD A, 2:3 
LOAD B, 5:2 
PROD A, B 
STORE 2:3, A 
• Because there are more lines of code, more RAM is needed to 
store the assembly level instructions. 
• The compiler must also perform more work to convert a high-level 
language statement into code of this form
Why THUMB?? 
• Most of the embedded processor uses risc 
architecture. 
• ARM introduced THUMB instruction set to reduce 
memory requirements 
• ARM7TDMI 
• On average, a Thumb implementation of the same 
code takes up around 30% less memory than the 
equivalent ARM implementation
How THUMB is implemented?? 
• 16 bit instruction –complete shorthand for subset of 
32 bit instruction set. 
• All 16 bit instruction has 32 bit equivalent 
• No special to access cpsr 
• Why 2 instruction set?—Expansion
Hardware 
•Difference between 32 bit and 16 bit equivalent
Register sets
Register set 
• 12 registers common-data can be passed 
• Push, pop ==> unique 
• monitoring thumb mode-cpsr
CODE DENSITY 
Arm code Thumb code
ARM-THUMB INTERWORKING 
• How do you switch from arm to thumb? 
• To call a Thumb routine from an ARM routine, 
the core has to change state. 
• Cpsr 7th bit-state change 
• BX,BLX 
 BX r0 –processor enters in to thumb mode if 
bit0 of the address is set.
ARM-THUMB INTERWORKING(cont.) 
• BX rm|label 
• Illustrating arm-thumb interworking:-
OTHER BRANCH INSTRUCTIONS
Data Processing Instruction-subset
Simple thumb addition
Load-Store Instructions
Load-Store Instructions
STACK INSTRUCTIONS: PUSH,POP
Summary 
• All Thumb instructions are 16 bits in length. 
• Thumb provides approximately 30% better 
code density over ARM code. 
• The Thumb instruction set includes POP and 
PUSH instructions as stack operations. 
• There are no Thumb instructions to access the 
coprocessors cpsr, and spsr.
ARM_Thumb mode

ARM_Thumb mode

  • 1.
    THUMB MODE VarunK 144520 Nitw ARM
  • 2.
    CISC Vs RISC • CISC • complete a task in as few lines of assembly • MULT 2:3, 5:2;; "complex instruction.“ • "a = a * b“ • Advantage:compiler has to do very little work, very little RAM is required to store instructions
  • 3.
  • 4.
    CISC Vs RISC • RISC • RISC processors only use simple instructions that can be executed within one clock cycle. • LOAD; PROD; STORE. • LOAD A, 2:3 LOAD B, 5:2 PROD A, B STORE 2:3, A • Because there are more lines of code, more RAM is needed to store the assembly level instructions. • The compiler must also perform more work to convert a high-level language statement into code of this form
  • 5.
    Why THUMB?? •Most of the embedded processor uses risc architecture. • ARM introduced THUMB instruction set to reduce memory requirements • ARM7TDMI • On average, a Thumb implementation of the same code takes up around 30% less memory than the equivalent ARM implementation
  • 6.
    How THUMB isimplemented?? • 16 bit instruction –complete shorthand for subset of 32 bit instruction set. • All 16 bit instruction has 32 bit equivalent • No special to access cpsr • Why 2 instruction set?—Expansion
  • 7.
    Hardware •Difference between32 bit and 16 bit equivalent
  • 8.
  • 9.
    Register set •12 registers common-data can be passed • Push, pop ==> unique • monitoring thumb mode-cpsr
  • 10.
    CODE DENSITY Armcode Thumb code
  • 11.
    ARM-THUMB INTERWORKING •How do you switch from arm to thumb? • To call a Thumb routine from an ARM routine, the core has to change state. • Cpsr 7th bit-state change • BX,BLX  BX r0 –processor enters in to thumb mode if bit0 of the address is set.
  • 12.
    ARM-THUMB INTERWORKING(cont.) •BX rm|label • Illustrating arm-thumb interworking:-
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
    Summary • AllThumb instructions are 16 bits in length. • Thumb provides approximately 30% better code density over ARM code. • The Thumb instruction set includes POP and PUSH instructions as stack operations. • There are no Thumb instructions to access the coprocessors cpsr, and spsr.