Last updated on August 28th, 2020 at 03:44 pm
Flag Registers of 8086 Processor:
There are 6 status flag registers and 4 control flag registers. Following are the 9 active flag registers of 8086 with their purposes.
Status Flag Registers:
1. Overflow Flag (OF):
Overflow Flag is set to 1 when there is a signed overflow. For example, when you add bytes 100 + 50 (result is not in range -128…127).
2. Sign Flag (SF):
Sign Flag is set to 1 when result is negative. When result is positive it is set to 0. This flag takes the value of the most significant bit.
3. Zero Flag (ZF):
Zero Flag (ZF) is set to 1 when result is zero. For non-zero result this flag is set to 0.
4. Auxiliary Flag (AF):
Auxiliary Flag is set to 1 when there is an unsigned overflow for low nibble (4 bits).
5. Parity Flag (PF):
Parity Flag is set to 1 when there is even number of one bits in result, and to 0 when there is odd number of one bits.
6. Carry Flag (CF);
Carry Flag is set to 1 when there is an unsigned overflow. For example when you add bytes 255 + 1 (result is not in range 0…255). When there is no overflow this flag is set to 0.
Control Flag Registers:
1. Direction Flag (DF):
Direction Flag is used by some instructions to process data chains, when this flag is set to 0 – the processing is done forward, when this flag is set to 1the processing is done backward.
2. Interrupt Enable Flag (IF):
When Interrupt Enable Flag is set to 1 CPU reacts to interrupts from external devices.
3. Trap Flag (TF):
Trap Flag is used for on-chip debugging.
thanks for this,
Glad to see my posts helping others …
so what about system flag, its also a fag register?
I don't study these things for nearly 4 years, these are my notes when I was having the course at campus. However, I don't know about anything called "System Flag", it might be the status of flag registers, like Trap flag is a system flag.
I MAY BE WRONG IN THIS CASE, THIS IS NOT MY FIELD OF PRACTICE.
There is no system flag. Its Sign Flag(SF).It is used to indicate whether the bit is negative or not…..
I also used to know that there is no System Flag.
Comments are closed.