November 15, 2016

Register Organization

Within the processor, there is a set of registers that function as a level of memory above main memory and cache in the hierarchy. The registers in the processor perform two roles:
 
User-visible registers: A user-visible register is one that may be referenced by means of the machine language that the processor executes. Enable the machine- or assembly language programmer to minimize main memory references by optimizing use of registers. We can characterize these in the following categories:
General purpose: General-purpose registers can be assigned to a variety of functions by the programmer.
Data: Data registers may be used only to hold data and cannot be employed in the calculation of an operand address.
Address: Address registers may themselves be somewhat general purpose, or they may be devoted to a particular addressing mode.
Condition codes: Condition codes are bits set by the processor hardware as the result of operations. E.g. result of last operation was zero.

Control and status registers: Used by the control unit to control the operation of the processor and by privileged, operating system programs to control the execution of programs. Most of these, on most machines, are not visible to the user.
Different machines will have different register organizations and use different terminology. Four registers are essential to instruction execution:
Program counter (PC): Contains the address of an instruction to be fetched.
Instruction register (IR): Contains the instruction most recently fetched.
Memory address register (MAR): Contains the address of a location in memory.
Memory buffer register (MBR): Contains a word of data to be written to memory or the word most  recently read.

No comments:

Post a Comment