0
8.3kviews
Short note: Stae use of control flags of 8086

enter image description here

Control Flag:- Out of nine active flags, six are conditional flags and the remaining three are called as the control flag. The three control flags are:

  1. The Trap flag(TF)
  2. The interrupt flag(IF)
  3. The direction flag(DF)

The Trap Flag: · Setting TF puts the processor into single step mode for debugging, In single stepping microprocessor executes a instruction and enters into single step ISR. · If TF=1, the CPU automatically generates an internal interrupt after each instruction, allowing a program to be inspected as it executes instruction by instruction.

The Interrupt Flag:- · If IF=1, the CPU will recognize external interrupt request (Interrupt Disabled). If IF=0, then interrupt disabled. · Clearing IF disables these interrupts. · IF has no effect on either non-maskable external or internally generated interrupt.

The Direction Flag:- · This bit is specially for string instructions. · If DF=1, the string instruction will automatically decrement the pointer. If DF=0,the string instruction will automatically increment the pointer.

1 Answer
1
128views

Control flags

They are set using certain instructions. They are used to control certain operations of the processor.

enter image description here

a) TF (Trap Flag):

This flag is used if we need single-step debugging in our code. If the TF is set, then the execution will be done step by step by generating internal interrupts after the execution of each instruction. Otherwise, the free-running operation will be done. Can be used to debug errors in programs by the programmer by doing single-stepping.

b) IF (Interrupt Flag):

To allow or prohibit the interruption of a program. If the flag is set, causes the 8086 to recognize external interrupts. Clearing IF disables these interrupts. It is used to mask (disable) or unmask (enable) the INTR interrupt.

c) DF (Direction flag):

Used with string instructions. If the flag bit is ‘0’, the string is processed in auto-incrementing mode. Otherwise in decrementing mode if flag bit is 1.

enter image description here

Please log in to add an answer.