72
F. Firouzi et al.
Fetch
Decode
Execute
Fetch
Decode
Fetch
Decode
Execute
Execute
Cycle 1
Cycle 2
Cycle 3
Cycle 4
Cycle 5
Instruction 1
Instruction 2
Instruction 3
Fig. 2.13 An example of a pipeline of Cortex-M
r0
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r11
r12
R13 (SP)
R14 (LR)
R15 (PC)
xPSR
Low registers
High registers
Program Counter
Program Status Register
Link Register
Stack Pointer
Fig. 2.14 Registers of Cortex-M
Register Registers are dedicated, specialized memory circuit in processors that can
be read or written to faster than normal memory. The contents (operands) of registers
are directly available as input for the processor. This means that instructions with
operands in the registers can be executed more quickly. A register is used to hold
information like states of CPU execution or computation results. Therefore, those
microcontrollers that are designed for higher speed usually have a larger number
of internal registers. Generally, an ARM processor includes the following 32-bit
registers (see Fig. 2.14):
• General-Purpose Registers – Thirteen 32-bit registers (R0-R12), for general data
operations:
– Registers R0-R7 – Accessible by 16-bit and 32-bit instructions
– Registers R8-R12 – Accessible by all 32-bit instructions that define a generalpurpose register but inaccessible to 16-bit instructions
F. Firouzi et al.
Fetch
Decode
Execute
Fetch
Decode
Fetch
Decode
Execute
Execute
Cycle 1
Cycle 2
Cycle 3
Cycle 4
Cycle 5
Instruction 1
Instruction 2
Instruction 3
Fig. 2.13 An example of a pipeline of Cortex-M
r0
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r11
r12
R13 (SP)
R14 (LR)
R15 (PC)
xPSR
Low registers
High registers
Program Counter
Program Status Register
Link Register
Stack Pointer
Fig. 2.14 Registers of Cortex-M
Register Registers are dedicated, specialized memory circuit in processors that can
be read or written to faster than normal memory. The contents (operands) of registers
are directly available as input for the processor. This means that instructions with
operands in the registers can be executed more quickly. A register is used to hold
information like states of CPU execution or computation results. Therefore, those
microcontrollers that are designed for higher speed usually have a larger number
of internal registers. Generally, an ARM processor includes the following 32-bit
registers (see Fig. 2.14):
• General-Purpose Registers – Thirteen 32-bit registers (R0-R12), for general data
operations:
– Registers R0-R7 – Accessible by 16-bit and 32-bit instructions
– Registers R8-R12 – Accessible by all 32-bit instructions that define a generalpurpose register but inaccessible to 16-bit instructions
