Today Task: Solving Question 1
Today Task: Solving Question 1
For each of the following instructions, give the new destination contents and the new
settings of CF, SF, ZF, PF, AF, and OF. Suppose that the flags are initially O in each part
al this question.
Suppose SUB AX, BX is executed. In each of the following parts, the first number is the
initial content of AX and the second number is the contents of BX. Give the resulting value
of AX and tell whether signed or unsigned overflow occurred.
a. 2143h
1986h
b. 80EEh
1986h
Solving question 1
a. NEG AL where AL contains 7Fh
7=0111,F=1111 binary
1’s complement =1000 0000
AL = 1000 0000
BL = 1111 1111
1000 0000
+1111 1111
__________
10111 1111
AL = 17FH
CF = 1
SF = 0
ZF = 0
PF = 0
OF =1
AX = 8000H
CF = 1
SF = 1
ZF = 0
PF = 1
OF = 1
Solving question 2
A. 2143h – 1986h
2143h = 0010 0001 0100 0011
1986h = 0001 1001 1000 1101
AX = 7BDH
CF = 0 unsigned overflow 0
B. 80EEh -1986h
AX = 6768H
CF =0 so Unsigned overflow 0