1.ARM Architecture, Instruction
1.ARM Architecture, Instruction
Processors
CISC Vs RISC
RISC - Reduced Instruction Set Computer - uses simple commands that can be divided into several
instructions which achieve low-level operation within a single CLK cycle.
CISC - Complex Instruction Set Computer - single instructions can perform numerous low-level
operations like a load from memory, an arithmetic operation, and a memory store or are
accomplished by multi-step processes or addressing modes in single instructions
CISC Vs RISC
RISC CISC
1. RISC stands for Reduced Instruction Set Computer. 1. CISC stands for Complex Instruction Set Computer.
2. RISC processors have simple instructions taking about 2. CSIC processor has complex instructions that take up
one clock cycle. The average clock cycle per instruction multiple clocks for execution. The average clock cycle per
(CPI) is 1.5 instruction (CPI) is in the range of 2 and 15.
3. Performance is optimized with more focus on software 3. Performance is optimized with more focus on hardware.
4. It has no memory unit and uses a separate hardware to 4. It has a memory unit to implement complex
implement instructions.. instructions.
5. It has a hard-wired unit of programming. 5. It has a microprogramming unit.
10. RISC processors are highly pipelined 10. They are normally not pipelined or less pipelined
15. It does not require external memory for calculations 15. It requires external memory for calculations
– 32 Bit architecture
– Uses RISC architecture
– Has large uniform register file
– Load - store architecture
– Uniform and fixed length instructions – 32 bit
– Good speed / power consumption ratio
– High code density
ARM Processor - Products
ARM Architecture.
ARM core Dataflow model
ARM Architecture.
i
n
s
t i Fetch Decode Execute
r
u Fetch Decode Execute
i+1
c
t
i i+2 Fetch Decode Execute
o cycle
n
t t+1 t+2 t+3 t+4
Operating Modes
– Seven operating modes:
– User
– Privileged:
– System (version 4 and above)
– FIQ
– IRQ
– Abort exception modes
– Undefined
– Supervisor
Operating Modes
– User mode is the usual ARM program execution state, and is used for
executing most application programs.
– Fast Interrupt (FIQ) mode supports a data transfer or channel process.
– Interrupt (IRQ) mode is used for general-purpose interrupt handling.
– Supervisor mode is a protected mode for the operating system.
– Abort mode is entered after a data or instruction Prefetch Abort.
– System mode is a privileged user mode for the operating system.
– Undefined mode is entered when an undefined instruction is executed.
Operating Modes
N Z CV I F T Mode
– This removes the need for many branches, which stall the pipeline (3 cycles to refill).
– Allows very dense in-line code, without branches.
– The Time penalty of not executing several conditional instructions is frequently less than overhead of
the branch
or subroutine call that would otherwise be needed.
The Condition Field
31 28 24 20 16 12 8 4 0
Cond
0011 = LO / CC - C clear (unsigned lower) 1100 = GT - Z clear, and either N set and V set, or N clear
0100 = MI -N set (negative) and V set (>)
0101 = PL - N clear (positive or zero) 1101 = LE - Z set, or N set and V clear,or N clear and V set
0110 = VS - V set (overflow) (<, or =)
➢ Shadow Registers
– R14 is used as the subroutine link register (LR) and stores the return address
when Branch with Link operations are performed & calculated from the PC.
– Thus to return from a linked branch
– MOV r15,r14
or
– MOV pc,lr
Exception Handling and the Vector
Table
– When an exception occurs, the core:
0x00000000 Reset
– Copies CPSR into SPSR_<mode>
0x00000004 Undefined Instruction
– Sets appropriate CPSR bits
0x00000008 Software Interrupt
If core implements ARM Architecture 4T and is currently in Thumb state, then
0x0000000C Prefetch Abort
ARM state is entered. Data Abort
0x00000010
Mode field bits 0x00000014 Reserved
Interrupt disable flags if appropriate. 0x00000018 IRQ
Cond 0 0 0 0 0 0 A S Rd Rn Rs 1 0 0 1 Rm
– Conditional execution:
– Each data processing instruction
prefixed by condition code
– Result – smooth flow of instructions through pipeline
– 16 condition codes:
signed greater
EQ equal MI negative HI unsigned higher GT
than
unsigned lower or signed less than
NE not equal PL positive or zero LS LE
same or equal
Data processing
instructions
Data transfer
instructions
Block transfer
instructions
Branching instructions
Multiply instructions
Software interrupt
instructions
ARM Instruction set
2. Branch Instructions
i. Move
ii.Arithmetic
iii.Logical
iv.Comparison
v.Multiply
Move instruction:
Syntax:
Syntax:
MOV
MVN
Move Instruction
36
Syntax:
MOV R0, R1
MVN R0, R1
MOVE instuctions Cntd:
MOV R0, #7
– Instructions:
MUL Multiply 32-bit result