Control register

From Wikipedia, the free encyclopedia

A control register is a processor register which changes or controls the behavior of a CPU or other digital device. Common tasks performed by control registers include:

[edit] Control registers in x86 series

  • CR0 :

The CR0 Register has 6 bits. The low 5 bits of the CR0 register, and the highest bit. Here is a representation of CR0:

CR0: |PG|----RESERVED----|ET|TS|EM|MP|PE|

PE - Puts the system into protected mode.

PG - PG turns on memory paging.

MP - The "Monitor Coprocessor" flag, which controls the operation of the "WAIT" instruction.

ET - The Extension Type Flag. ET (also called "R") tells us which type of coprocessor is installed. If ET = 0, an 80287 is installed. if ET = 1, an 80387 is installed.

EM - The Emulate Flag. When this flag is set, coprocessor instructions will generate an exception.

TS - The Task Switched flag. This flag is set automatically when the processor switches to a new task.

  • CR1 - Reserved (used in segmentation)
  • CR2 - Contains a value called Page Fault Linear Address (PFLA). When a page fault occurs, the address accessed is stored in CR2.
  • CR3 - Used when PG is set. CR3 enables the processor to locate the page table directory for the current task. Last 20 bits of CR3 point to Page directory base register (PDBR).
  • CR4 - Used in protected mode to control operations such as virtual-8086 support, enabling I/O breakpoints, page size extension and machine check exceptions.

[edit] See also

[edit] External Links