The Reversers.org Vault : RegistersDef

HomePage :: Categories :: PageIndex :: Files :: RecentChanges :: RecentlyCommented :: Login/Register

Definition of registers


Required Knowledge
None.

Registers
Registers, from an engineer's point of view, are small pieces of memory (hence the name 'register memory') which are much faster, in terms of access time, than the bulk of memory on your mainboard. The register memory is located on the CPU. The size and amount of these pieces of register memory is dependant on the architecture of the processor. Taking the x86 architecture as an example, each piece of register memory is 32 bits (4 bytes) wide and is aranged as shown below.

Registers diagram.
In the above diagram we can see that a register is 32 bits and is split up in to 4 overlapping areas.
Each ? can be replaced with A/B/C or D to represent the various basic registers.
Taking EAX as an example, EAX represents the entire scope of the register, the full DWORD value. However, the 'first' (least significant) WORD value can be accessed by using the operand AX. Similarly, the first and second BYTES can be accessed using AL and AH respectively. The above diagram explains the 'structure' of the four ABCD registers (EAX, EBX, ECX and EDX). They have 32/16 and 8-bit addressing modes (EAX/AX and AH/AL, etc.) however the other registers do not have any way of being addressed as 8-bit registers, ie. they have only 32 and 16-bit components.
Thus, the registers ESI, EDI, EBP and ESP can simply be addressed as SI/DI/BP and SP, when 16-bit operations are required. EIP can be considered for all purposes as a pure 32-bit register, but you can't really move anything out or in to it, so can be ignored.

Access of the individual registers is restricted to assembly level programming (at least in all the programming languages I've seen) and the above sections of each register can be accessed individually through various opcodes.
The following are the basic x86 CPU registers (General purpose registers):

As well as these general purpose registers there many other registers available to the assembly programmer / reverser. These registers are more specific in their purpose. For instance the FPU registers are used in floating point operations and are optimized for this function.
Links to other register sets can be followed in the "Related links" section below.


Related links
Todo: Put links to other register sets here.

  Attachment Size Date Added
      Registers.PNG   1.57 KB   7/18/2005 11:22 am
 


Categories
CategoryDefinitions

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.0
Page was generated in 0.1992 seconds