7 FLAGS Register of 8086

Flags is a 16-bit register containing 9 one bit flags


Status Flag

•Carry Flag – CF (bit 0)
– Set (1) if an arithmetic operation generates a carry or a borrow out of the most-significant bit of the result; otherwise reset (0).

•Parity Flag – PF (bit 2)
– Set if the least-significant byte of the result contains an even number of 1 bits; otherwise reset.

•Auxiliary carry – AF (bit 4)
– Set if an arithmetic operation generates a carry or a borrow out of bit 3 of the result; otherwise reset.

•Zero Flag – ZF (bit 6)
– Set if the result is zero; otherwise reset.

•Sign Flag – SF (bit 7)
– Set equal to the most-significant bit of the result, which is the sign bit of a signed integer

•Overflow Flag – OF (bit 11)
– Set if the integer result is too large a positive number or too small a negative number (excluding the sign-bit) to fit in the destination operand; otherwise reset.

Control Flag

•Direction Flag (DF)
When it is set, string related instructions decrement index registers. When it is reset, string related instructions increment index registers

Interrupt-enable Flag (IF)
When it is set, enables maskable interrupts otherwise disable maskable interrupt.

Single-step Flag (TF)
- if set then single-step interrupt will occur after the next instruction.
Previous
Next Post »