Registers
Registers are fast Memory that are fetched. A processor register is a quickly accessible location available to a computer’s processor. Registers usually consist of a small amount of fast storage, although some registers have specific hardware functions, and may be read-only or write-only.
-
CPU instructions:
- read from memory
-
MIPS has 32 registers that called “general purpose”
-
ARM has 64 registers (I think)
-
The registers hi and lo (for multiplication and division)
-
Some general-purpose registers are special:
- $0 is always 0
- $31 is for return addresses
- $30 is our stack pointer
- $29 is our frame pointer
Two categories of visible registers:
- Data registers: store data
- Address register: point to memory
There are also invisible registers (Control and Status Registers):
- Program Counter for example
- Invisible to the user (on most architectures)
- Used by Processor to control operating of the computer
- Used by privileged OS routines to control the execution of programs
MIPS Instructions
Special register = Program Counter that fixes the problem of how MIPS know what to do next.
In Assembly language, registers have global scope.