
THE ARCHITECTURE OF 8086 1-7
Example 1.1
Find the status of the flags CF, SF and AF after the following instructions are executed.
MOV AL, 35H
ADD AL, 0CEH
Solution
The format of a MOV instruction is MOV destination, source.
In the above two instructions, a number 35H is first moved to AL. In the next line,
0CEH is added to AL. The sum will be in AL, the destination register.
35H 0011 0101 +
+ CEH 1100 1110
103H 1 0000 0011
After computation, AL will contain 0000 0011 and
CF = 1 since there is a carry out from D7.
SF = 0 since the sign bit (MSB) of the 8-bit destination is 0.
AF = 1 since there is an overflow from D3 to D4.
Example 1.2
Sho ...