Lecture 3 - Arm Architecture
Lecture 3 - Arm Architecture
and Overview
ARM Microprocessor Architecture
What we will learn in this section:
ARM REGISTER
ARM GENERAL PURPOSE REGISTERS (GPRs)
Current Program Status Register (CPSR )
Memory Map System
3
Basic Elements of a Central Processing Unit
Address Bus
Program Counter
Instruction Register
Flags ALU
Instruction decoder, Control Bus
timing, and control
Data Bus
Register B
Register C
Register D
ARM REGISTERS
In the CPU, registers are used to store information temporarily
and most of the operations, such as arithmetic and logic
operations, involve the registers
That information could be a piece of data to be
processed or an address pointing to the data to be
fetched
To program in assembly language, we must understand the
registers of a given CPU and the role they play in processing
data
ARM General Purpose Registers (GPRs)
All of ARM registers are 32-bit wide. The 32 bits of a register are shown in Figure 2-1.
These range from the MSB (most-significant bit) D31 to the LSB (least-significant bit) D0.
With a 32-bit data type, any data larger than 32 bits must be broken into 32-bit chunks
before it is processed.
C - Carry flag
N- negative flag • C=1 when there is a
• N=0 when the D31 bit of the carry out from bit D31
result is 0 which means the • It is affected by
result is +ve Z - zero flag
• Z=1 when the result addition or subtraction
• N=1 when the D31 bit of the
result is 1 which means the is zero
result is -ve • Z=0 when the result
• It is used for the signed is non-zero
number arithmetic operations • It is used in loops
ARM Instruction Format
uses the “tri-part” instruction format (most common format)
instruction destination, source1, source2
where
source1, source2 can be a register, immediate (constant)
value, or memory
destination is often a register or read/write memory
ARM instructions operate on the data in the registers with the
exception of load and store instructions, which move the
data between registers and memory
MOV instruction
Uses to copies data into register or from register to register.
MOV Rn,Op2 ;load Rn register with Op2 (Operand2)
;Op2 can be immediate
Op2 can be an immediate (constant) number #K which is
an 8-bit value that can be 0–255 in decimal, (00–FF in hex).
Op2 can also be a register Rm. Rn or Rm are any of the
registers R0 to R15.
MOV instruction (Immediate Values)
Example: To add two numbers such as 0x25 and 0x34, one can do either:
or
MOV R1, #0x25 ; load (copy) 0x25 into R1 (R1 = 0x25)
ADD R5, R1, #0x34 ; add 0x34 to R1 and put it in R5 (R5 = R1 + 0x34)
Example 2-1
Show the status of the C and Z flags after the addition of
0x0000009C and 0xFFFFFF64 in the following instruction:
; assume R1 = 0x0000009C and R2 = 0xFFFFFF64
ADDS R3, R1, R2 ; add R1 to R2 and place the result in R3
External
1.0GB
Mainly used for external peripherals. device
0xE0000000
0xDFFFFFFF
External
Mainly used for external memory. 1.0GB
RAM 0x43FFFFFF
0x60000000 0x42000000
0x5FFFFFFF
Although the CPU can access 4GB of locations, no ARM chips have the
entire 4GB of on-chip memory populated.