2.1 General-Purpose Registers

The x86 CPU has eight general purpose registers: eaxebxecxedxespebpesi, and edi. These registers are 32 bits (4 bytes) in size. A program can access registers as 32-bit (4 bytes), 16-bit (2 bytes), or 8-bit (1 byte) values. The lower 16 bits (2 bytes) of each of these registers can be accessed as axbxcxdxspbpsi, and di. The lower 8 bits (1 byte) of eaxebxecx, and edx can be referenced as alblcl, and dl. The higher set of 8 bits can be accessed as ahbhch, and dh. In the following diagram, the eax register contains the 4-byte value 0xC6A93174. A program can access the lower 2 bytes (0x3174) by accessing the ax register, and it can access the lower byte (0x74) by accessing the ...

Get Learning Malware Analysis now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.