Arm Microprocessor
Arm Microprocessor
Brief History
ARM (Advanced Risc Machine) Microprocessor was based on the Berkeley/Stanford Risc concept
Originally called Acorn Risc Machine because developed by Acorn Computer in 1985 Financial troubles initially plagued the Acorn company but the ARM was rejuvenated by Apple, VLSI technology, and Nippon Investment and Finance
Basics
Only 25 basic instruction types 3 stage instruction pipeline All instructions are one word long All instructions are predicated
Basics (Contd.)
Pipeline
Decode Area
Empty Instruction 1 Instruction 2 Instruction 3
Execution Area
Empty Empty Instruction 1 Instruction 2
1 2 3 4
Memory
Memory (contd.)
ARM has a 26 bit wide addressing range which allows 64 mb of memory to be directly addressed
Memory Access:
Register Indirect Addressing Pre and Post Indexed Addressing PC Relative Addressing Byte and Word Addressing
Registers
32 bit registers: 13 general purpose registers, R0 to R12 R13 generally used as a Stack register R14 as the Link register R15 is the Program Counter and Status register
Status Register
Status register bits indicate either processor mode, fast interrupt mode, normal interrupt mode, and also the overflow, carry, zero, and negative flags
Condition
Four most significant bits indicate one of sixteen possible conditions for an instruction:
EQ (Equal) 0000; NE (Not Equal) 0001; CS (Carry Set) 0010; CC (Carry Clear) 0011; MI (Minus) 0100; PL (Plus) 0101; VS (Overflow Set) 0110; VC (Overflow Clear) 0111; HI (Higher) 1000; LS (Lower or Same) 1001; GE (Greater or Equal) 1010; LT (Less Than) 1011; GT (Greater Than) 1100; LE (Less than or Equal) 1101; AL (Always) 1110; NV (Never) 1111
Given the condition bits, an instruction will either be executed or ignored depending on status bits
Branch
Branch instruction can transfer program execution by loading a new value into the PC.
Branch with link is same except address of next instruction is saved in R14, the link register allows a single subroutine to be called
Stacks
Stacks are implemented using LDM (Load Multiple Register) and STM (Store Multiple Register) instructions and FD, ED, EA, and FA can be added to represent full, descending; empty, descending; empty, ascending; and full, ascending, respectively Used for nested or recursive subroutines
Interrupts
Software Interrupt
Use of Software Interrupt instruction (SWI) causes ARM to go into supervisor mode with private registers R13_svc and R14_svc as extras to allow OS kernel to protect the stack and link registers
Instruction types
Immediate Addressing
Direct Addressing Mode is not possible with the original ARM microprocessor after setting aside bits for the opcode and operands, only 12 bits remain for an immediate value to be used
This is not enough, but it simulates 32 bits in most cases by splitting the 12 bit field into an 8 bit data field and a 4 bit shift field
4 bit field can shift an 8 bit data field into any one of 16 possible positions
If necessary to use a complete 32 bit word, then break it up into four groups of 8 bits and use shift and add instructions to reassemble it
Shift instructions
Shift instruction fields are 5 bits, so shifts can accurately place in up to all 32 positions
Shift instructions: LSL logical shift left, ASL Arithmetic shift left, LSR Logical shift right, ASR Arithmetic shift right, ROR Rotate right, RRX Rotate right with extend
Included in data path for any of the 18 data processing instructions is the barrel shifter, which allows a shift or rotate instruction (on 2nd operand) to be appended to these instructions without needing another cycle
Eg. ADD R3, R1, R2, LSL#4 which shifts bits in R2 four places to the left and then adds to R1 and then places it in R3
Conclusion
Hardwired logic and the barrel shifter make the ARM very fast also