Introduction to register set and data types of x86 32-bit processor | cpuinfo
Posts Introduction to register set and data types of x86 32-bit processor
Post
Cancel

Introduction to register set and data types of x86 32-bit processor

Register Set

The register set is divided into three categories:

  1. General Purpose Registers
  2. Special Purpose Registers
  3. Control Registers

There are total eight (8) general purpose registers and two (2) special purpose registers in x86 (32-bit). Apart from this there are five (5) control registers. The prupose of each of these registers is tabulated below:

General Purpose Registers

Register NamePurpose
EAXAccumulator
EBXIt has no specific uses, but is often set to a commonly used value (such as 0) throughout a function to speed up calculations
ECXCounter in loops
EDXOccasionally used as a function parameter or generally used for storing short-term variables within a function
ESISource in string/memory operations
EDIDestination in string/memory operations
EBPBase frame pointer
ESPStack pointer

Special Purpose Registers

Register NamePurpose
EIPInstruction Pointer
EFLAGSFlags to store the status of arithmetic operations and other execution states (e.g., trap flag).

Control Registers

The important registers that are used to control low-level system mechanisms such as virtual memory, interrupts, and debugging are listed below:

Register NamePurpose
CR0Controls whether paging is on or off
CR1Reserved, the CPU will throw an exception when trying to access it.
CR2Linear address that caused a page fault aka Page Fault Linear Address (PFLA)
CR3Base address of a paging data structure
CR4Controls the hardware virtualization settings
DR0 – DR7Used to set memory breakpoints
CR5-7Reserved

Data Types

Following four types of data would be most commonly used in programming the x86 processor.

  • Bytes - 8 bits. Examples: AL , BL , CL
  • Word - 16 bits. Examples: AX , BX , CX
  • Double word - 32 bits. Examples: EAX , EBX , ECX
  • Quad word - 64 bits
This post is licensed under CC BY 4.0 by the author.