//word of the day: pedagogical
good read :
Developing modules for the Apache HTTP Server 2.4
Crash into Assembly x86
The x86 Architecture:
- ALU(The arithmetic logic unit(ALU) executes an instruction fetched from RAM and places the results in registers or memory.
EFLAGS for the result of operation: 0️⃣ or 1️⃣
- ZF : The zero flag is set when the result of an operation is equal to zero,(normal)
- CF : The carry flag is set when the result of an operation is too large or too small for the destination operand, otherwise (normal)
- SF : The sign flag is set when the result of an operation is negative. also set when the most significant bit is set after an arithmetic operation.
- TF: The trap flag. for debugging. only one instruction will be executed at a time. /xCC
SUB dest, Value will modify two flags: ZF, CF. ZF will be set if the result is zero, and CF is set if the dest is less than the value used to subtract.
Bits shifted beyond the destination boundary are first shifted into
the CF flag.
ROR, ROL, flip the high and low indices of a register.
Function calls are made by Call, *function_in_memory_address. Push EIP for later Leave.
Each time a call is performed, a new stack frame is generated.