"How Processor Registers Work: The Fastest Memory in a CPU"
Processor Registers
A processor includes a set of registers that provide a level of memory that is faster and smaller than main memory . the register in the processor server two function:
User - visible registers :
Enable the machine or assembly-language programmer to minimize main memory references by optimizing register use. For high-level languages , an optimizing compiler will attempt to make intelligent choices of which variable to assign to registers and which to main memory locations. Some high-level languages , such a C allow the programmer to suggest to the compiler which variable should be held in registers.
Data registers - can be assigned to a variety of functions by the programmer . In some cases , they are general purpose in nature and can be used with any machine instruction that performs operations as data.
Address registers - contain main memory addresses of data and instructions , or they contain a portion of the address that is used in the calculation of the complete or effective address.
Control and status registers :
Used by the processor to control the operation of the processor and by privileged, operating - system routines to control the execution of programs. there is not a clean separation of registers into these two categories.
Program counter ( PC ) - contains the address of an instruction to be fetched.
Instruction register ( IR ) - contains the instruction most recently fetched .
Comments
Post a Comment