X86 Assembly Language - Registers

Registers

Further information: X86_architecture#x86_registers, MOV (x86 instruction)

x86 processors have a collection of registers available to be used as stores for binary data. Collectively the data and address registers are called the general registers. Each register has a special purpose in addition to what they can all do.

  • AX multiply/divide, string load & store
  • CX count for string operations & shifts
  • DX port address for IN and OUT
  • BX index register for MOVE
  • SP points to top of stack
  • BP points to base of stack frame
  • SI points to a source in stream operations
  • DI points to a destination in stream operations

Along with the general registers there are additionally the:

  • IP instruction pointer
  • FLAGS
  • segment registers (CS, DS, ES, FS, GS, SS) which determine where a 64k segment starts (no FS & GS in 80286 & earlier)
  • extra extension registers (MMX, 3DNow!, SSE, etc.) (Pentium & later only).

The IP register points to the memory offset of the next instruction in the code segment (it points to the first byte of the instruction). The IP register cannot be accessed by the programmer directly.

The x86 registers can be used by using the MOV instructions. For example:

mov ax, 1234h mov bx, ax

copies the value 1234h (4660d) into register AX and then copies the value of the AX register into the BX register. (Intel syntax)

Read more about this topic:  X86 Assembly Language

Famous quotes containing the word registers:

    We may prepare food for our children, chauffeur them around, take them to the movies, buy them toys and ice cream, but nothing registers as deeply as a simple squeeze, cuddle, or pat on the back. There is no greater reassurance of their lovability and worth than to be affectionately touched and held.
    Stephanie Martson (20th century)