0
9.4kviews
What are the functions of PC registers

What are the functions of following registers?

i) PC (ii) SP (iii) MAR (iv) MDR (v) IR

1 Answer
0
123views

The register in the processor perform two roles:

  1. User-visible registers:
  2. Enable the machine- or assembly language programmer to minimize main memory references by optimizing use of registers.
  3. Control and status registers:
  4. Used by the control unit to control the operation of the processor and by privileged, operating system programs to control the execution of programs.

User-visible registers:

We can characterize these in the following categories:

  • General purpose
  • Data
  • Address
    • Condition codes

General-purpose registers can be assigned to a variety of functions by the programmer.

Data registers may be used only to hold data and cannot be employed in the calculation of an operand address.

Address registers may themselves be somewhat general purpose, or they may be devoted to a particular addressing mode.

Examples include the following:

  1. Segment pointers
  2. A segment register holds the address of the base of the segment. There may be multiple registers:
  3. for example, one for the operating system and one for the current process.
  4. Index registers:
  5. These are used for indexed addressing and may be auto indexed.
  6. Stack pointer:
  7. If there is user-visible stack addressing, then typically there is a dedicated register that points to the top of the stack.
  8. This allows implicit addressing; that is, push, pop, and other stack instructions need not contain an explicit stack operand.

Condition codes: Condition codes are bits set by the processor hardware as the result of operations. For example, an arithmetic operation

Control and status registers:

  • There are a variety of processor registers that are employed to control the operation of the processor. Most of these, on most machines, are not visible to the user. Some of them may be visible to machine instructions executed in a control or operating system mode.
  • Of course, different machines will have different register organizations and use different terminology. Below listed here a reasonably complete list of register types, with a brief description

    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

  • Not all processors have internal registers designated as MAR and MBR, but some equivalent buffering mechanism is needed whereby the bits to be transferred to the system bus are staged and the bits to be read from the data bus are temporarily stored.

  • Typically, the processor updates the PC after each instruction fetch so that the PC always points to the next instruction to be executed.
  • A branch or skip instruction will also modify the contents of the PC. The fetched instruction is loaded into an IR, where the opcode and operand specifies are analyzed. Data are exchanged with memory using the MAR and MBR.
  • In a bus-organized system, the MAR connects directly to the address bus, and the MBR connects directly to the data bus. User visible registers, in turn, exchange data with the MBR.  
Please log in to add an answer.