Thursday, February 9, 2012

MEMORY REGISTERS

CPU REGISTERS

A processor takes data and instructions that are stored in memory and performs whatever calculations are required, then writes the output back into memory as applicable. However, the CPU needs a place to store the data it retrieves from memory while it calculates; this is where the registers come in. Registers are small segments of memory inside the CPU that are used for temporarily storing data; some have specific functions, others are just used for general data storage. 

There are many registers used by a processor, but we are concerned primarily with a group of registers called the general purpose registers. The general purpose registers are composed of:

AMD64_EM64T_architectur
EAX : Extended Accumulator Register
EBX : Extended Base Register
ECX : Extended Counter Register
EDX : Extended Data Register
ESI : Extended Source Index
EDI : Extended Destination Index
EBP : Extended Base Pointer
ESP : Extended Stack Pointer
EIP : Extended Instruction Pointer  
  • The EAX register is called the accumulator, and is commonly used to hold the results of a calculation.  
  • EBX is a pointer to the data segment, and ECX is normally used to count the number of iterations in a loop; EDX is used as an I/O pointer.
  • ESI and EDI are used to specify source and destination addresses respectively; they are most often used when copying strings from one memory address to another.
  • ESP is a stack register, called a stack pointer, that points to the top of the stack; EBP is also a stack register (called the base pointer), used to reference local variables and function arguments on the stack.  
  • EIP is the instruction pointer register - it controls program execution by pointing to the address of the next instruction to be executed.
  • The 'E' at the beginning of each register name stands for Extended.  

 (source : ethicalhacker.net , wikipedia , code )

0 comments:

Post a Comment