Advanced RISC Machines are a set of CPUs that are based on the RISC architecture.
The address bus has 32b. Therefore, it can access 4GB of memory. The same memory is used for code and data as it follows Von Neumann architecture.
The PC also has 32b. It contains the address of the next instruction. However since, each instruction is 32b = 4B long, the PC increments by 4 each time. So the two lower bits of the PC are insignificant.
Is also 32b. Is used for reading/writing data and fetching instruction opcode. The instruction opcode will be given to the Instruction decoder to identify the operation. Data that is read from the data bus can be 8b, 16b or 32b. It will be given to Sign extender before being stored in a 32b register.
The ALU is also 32b long. It performs arithmetic on registers and then stores the result in registers as well, while updating the flag register.
It is a logic shifter. It can shift multiple times in one cycle. It is used to prescale an operand before giving it to the ALU. It can also act on a singler register, and can also rotate the data in a register.
ARM has a total of 37 registers, each 32b (4B) long. Among them, R0 - R15 are general purpose registers (GPRs). And among these GPRs, some are special registers like -
It is used to perform multiply operation with accumulation.
MAC R0, R1, R2, R3
is equivalent to R0 = R1 * R2 + R3
It holds the address of operands during LOAD and STORE instruction. It has its own incrementor that is independent of the ALU. The incrementor is significant in base index addressing mode.
ARM7 has 7 operating modes, 7 interrupts and 7 addressing modes.
ARM7TDMI -
CPSR stands for current status program register. It is a status register.
Bit | Name | Description |
---|---|---|
31 | N | Negative flag |
30 | Z | Zero flag |
29 | C | Carry flag |
28 | V | Overflow flag |
24 | J | Jazelle |
7 | I | Interrupt mask |
6 | F | Fast interrupt mask |
5 | T | Thumb state |
43210 | Mode | Operating modes select |
The bits for selecting various operating modes are -
It is the normal mode in which all user programs are executed. It has limited access to memory and I/O flags. All other modes are entered through interrupts.
It is enabled when high priority interrupt is recevied from nFIQ pin. Nested interrupts are enabled in this mode. These interrupts are should be served with minimum delay.
It is enabled when interrupt is received from nIRQ pin. Nested interrupts are allowed. They are served with some delay.
It is enabled when RESET is triggered, to execute the BIOS program. It can be invoked via a software interrupts.
Abort mode is entered when an unsuccessful attempt is made to access memory. In this mode, some memory locations are not available.
We enter undefined mode when a coprocessor instruction is encountered and not found.
There are a total of 16 (R0 - R15) + 1 (CPSR) registers in each mode. But some of these are banked (unique to each mode).
Each instruction can be suffixed with EQ, GE, GT and so on to check with the status register and conditionally execute. This reduces branching.