2-Introduction To Microprocessor 8086 I
2-Introduction To Microprocessor 8086 I
by
Wait
EU and BIU work in parallel, with the BIU keeping one step ahead.
The major reason for this separation is to increase the processing speed
of the processor.
….
address 64 K
the current code segment for the next instruction
that will be executed by the CPU. FFFFH
This is set, if there is a carry from the lowest This flag is set, when there is a carry
nibble, i.e, bit three during addition, or borrow for out of MSB in case of addition or a
the lowest nibble, i.e, bit three, during subtraction. borrow in case of subtraction.
This flag is set, when the result of This flag is set, if the result of the This flag is set to 1, if the lower byte of the
any computation is negative computation or comparison performed result contains even number of 1’s ; for
by an instruction is zero, else it is set to 0. odd number of 1’s set to zero.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OF DF IF TF SF ZF AF PF CF
Tarp Flag
Over flow Flag If this flag is set, the processor enters the
This flag is set, if an overflow occurs, i.e, if the result of a signed operation is large
single step execution mode by generating
enough to accommodate in a destination register. The result is of more than 7-bits in
size in case of 8-bit signed operation and more than 15-bits in size in case of 16-bit
internal interrupts after the execution of
sign operations, then the overflow will be set. each instruction (Debugging Mode).
Flag register: is a 9-bits of its 16 bits contains bits that show the status
of some activities of the microprocessor.
Zero flag (ZF) : Set if result of arithmetic or logical of the most recent
instruction was zero; cleared otherwise
Sign flag (SF): Set if result of arithmetic of the signed numbers or logical
has a negative sign; cleared otherwise (i.e. the most significant bit - the
sign bit is 1).
overflow flag (OF): set if there was an overflow for signed operations
(a carry/borrow from the second most-significant bit)
Cary flag (CF): Set if there was a carry from or borrow to the most
significant bit during last result calculation
auxiliary carry flag (AF): set if there was a carry from or borrow to bits 0-3
in the AL register; cleared otherwise. It is used by instructions that
perform binary coded decimal (BCD) arithmetic.
Introduction to Microprocessor ( Lecture 2 : 8086 MP)
FLAG Register
Interrupt enable flag (IF): set this bit to enable external interrupts (such as
keyboard entry) are to be processed or ignored; Clear otherwise.
Single-step (Trap Flag TF) causes the 8086 to execute a single-step mode i.e.
one instruction at a time for “debugging” process. TF is cleared by the single-
step interrupt.
Direction flag (DF): Determines left or right direction for moving or comparing
string (character) data. When it is cleared (DF=0), the string operation is
performed from left to right data transfer, and when it is set (DF=1), the
string operation is performed from right to left data transfer (auto –
decrement ).
Parity flag (PF): Set if low-order 8 bits of result contain an even number of 1
bits; (set if parity (the number of "1" bits) in the low-order byte of the result
is even) cleared otherwise.