v3_Registers_and_Flags_of_80x86_Architecture.pdf

💡Recall

🖋 Notes

Registers

The EU general registers

EAX

EBX

ECX

EDX

ESP and EBP

ESP (Stack Pointer)

EBP (Base pointer)

EDI and ESI (Index Registers)

EAX, EBX, ECX, EDX, ESP, EBP, EDI, ESI

AX, BX, CX, DX, SP, BP, DI, SI

Flags

Screenshot 2022-10-20 at 18.37.44.png

CF (Carry Flag)

PF (Parity Flag)

AF (Auxiliary Flag)

Screenshot 2022-12-08 at 19.54.25.png

ZF (Zero Flag)

SF (Sign Flag)

TF (Trap Flag) (Debugging Flag)

IF (Interrupt Flag)

DF (Direction Flag)

OF (Overflow Flag)

Flags categories

The flags can be split into 2 categories with:

  1. previous effect generated by the Last Performed Operation (LPO):

    CF, PF, AF, ZF, SF and OF

  2. future effect after their setting by the programer, to influence the way the next instructions are run:

Specific instructions to set the flags values

Considering the 2nd category, it is normal that the assembly language to provide specific instructions to set the values of the flags that will have a future effect. So, we have 7 such instructions:

Given the major risk of accidentally setting the value from TF and also its absolutely special role to develop debuggers, there are NO instructions to directly access the value of TF !!