Instruction Set Architecture – Register Codes and Their Purpose
A register is a processor accessible to the central processing unit of a computer. Most registers can only be accessed by the processor, but some are read-write and have special hardware features. In a register machine, data is inserted or erased in either a volatile or static memory, depending on the type of register. A register can store instructions for execution or store temporary results. A register has a specific address and operation code set by the microprocessor.
Instructions are executed by the CPU through the instruction pointer (IP), which is saved in the instruction pointer register (IR). The pc will move the IP to an instruction register. A program executing on a pc reads instructions from an application register to the pc, the instruction pointer is then moved to the target register. Instructions can also be executed from the target register by loading a routine, which will load the target register and execute the instructions contained in it.
Instructions can be executed in two different ways. One method involves the use of an instruction pointer (IOP), which is saved in the target register. PC’s load IOP to the target register before executing instructions. Instructions are executed one instruction at a time, using the PC’s stack pointer (SS). Instruction pointers are saved to a non volatile storage and can only be accessed by the program counter register (PCRC). PCRC is used to track instructions and it is reset each time the program counter is called.
The other method of instruction execution is to use the program counter, which is accessed by the pc. The program counter is set to point to the address register which contains the target of the instruction pointer. When a program is executed by the pc, this instruction pointer is passed along to the instruction pointer register, where it points to the target of the instruction.
Instructions can be executed by the CPU in two different ways. The first way is through constant look up, which requires the execution of instructions multiple times over. This is done when a register is referenced repeatedly by the CPU. CPU look up instructions are very common in assemblers, as they allow the programmer to define constant or static variables. The second way that the register may be accessed is through register allocation, which involves an instruction to the CPU to map a register into RAM.
Allocation of registers to hold different numbers is called register allocation. A good example of register allocation is the implementation of a Math library. When a math library is created, a number of arithmetic instructions are specified, the effective address is stored into the index register for execution by the CPU, and the library is loaded. When the execute the instructions, the index register becomes the effective address and the contents of the register are written into the target register.