Registers
Registers are used to store data temporarily. Think of them as fast 8- to 32-bit chunks of
memory for use internally by the processor. Registers can be divided into four categories
(32 bits each unless otherwise noted). These are shown in Table 6-4.
Gray Hat Hacking: The Ethical Hacker??™s Handbook
132
General registers EAX, EBX, ECX, EDX Used to manipulate data
AX, BX, CX, DX 16-bit versions of the preceding entry
AH, BH, CH, DH, AL, BL, CL, DL 8-bit high- and low-order bytes of
the previous entry
Segment registers CS, SS, DS, ES, FS, GS 16-bit, holds the first part of a
memory address; holds pointers to
code, stack, and extra data segments
Offset registers Indicates an offset related to
segment registers
EBP (extended base pointer) Points to the beginning of the local
environment for a function
ESI (extended source index) Holds the data source offset in an
operation using a memory block
EDI (extended destination index) Holds the destination data offset in
an operation using a memory block
ESP (extended stack pointer) Points to the top of the stack
Special registers Only used by the CPU
EFLAGS register; the key flags to
know are ZF=zero flag; IF=
Interrupts; SF=sign
Used by the CPU to track results of
logic and the state of processor
EIP (extended instruction
pointer)
Points to the address of the next
instruction to be executed
Table 6-4 Categories of Registers
Chapter 6: Programming Survival Skills
133
PART III
References
x86 Registers www.
Pages:
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292