Basics Flashcards
x86::General Purpose Registers::EAX
Accumulator register - primarily used for common calculations, assigned one-byte opcodes for efficient calculations, also used for storing function return values
x86::General Purpose Registers::EBX
No special purpose in 32-bit architecture, often used as a catch-all for available storage
x86::General Purpose Registers::ECX
Counter register - used primarily for loop and counter iteration, can also store data
x86::General Purpose Registers::EDX
Data register - similar to EAX in purpose, used for mathematical operations often in conjunction with EAX, or to store function variables
x86::General Purpose Registers::ESI
Source index - often used to store the pointer to a read location
x86::General Purpose Registers::EDI
Destination index - Designed to hold storage pointers for functions, can be used to store data
x86::General Purpose Registers::EBP
Base pointer - Maintains pointer to base of stack, often used to locate objects in the stack by specifying base + offset
x86::General Purpose Registers::ESP
Stack pointer - Maintains pointer to top of stack, decrements/increments as objects are moved around, rarely ever used for any other purpose
x86::Special Purpose Registers::EIP
Instruction pointer - Maintains pointer to next instruction
x86::Segment Registers
Products of old addressing schemes and memory models, still used for backwards compatibility, other functions, and storage
x86::EFLAGS Register
Comprised of a series of flags that represent Boolean values, can be used for if/when logic, conditional jumps, etc
x86::Assembly::Instructions::ADD/SUB
Add or subtract two operands, store the result in the first operand
x86::Assembly::Instructions::XOR EAX, EAX
Exclusive or - in this case since the destination and source registers are the same, EAX will be zeroed out
x86::Assembly::Instructions::INC/DEC
Increment or decrement an operand by one
x86::Assembly::Instructions::CMP
Compare the value of two operands and set the appropriate EFLAGS value