Addition and Subtraction Instructions

This topic covers the ADD, SUB, INC, and DEC instructions, applied to register and immediate operands. Click here to view the answers.

1. Indicate whether or not each of the following instructions is valid.

(notate: V = valid, I = invalid) Assume that all operations are unsigned.

  
a.
add ax,bx
  
b.
add dx,bl
  
c.
add ecx,dx
  
d.
sub si,di
  
e.
add bx,90000
  
f.
sub ds,1
  
g.
dec ip
h.
dec edx
i.
add edx,1000h
j.
sub ah,126h
k.
sub al,256
l.
inc ax,1

 

2. What will be the value of the Carry flag after each of the following instruction sequences has executed?

(notate: CY = carry, NC = no carry)

  
a.
mov ax,0FFFFh
add ax,1
  
b.
mov bh,2
sub bh,2
  
c.
mov dx,0
dec dx
  
d.
mov al,0DFh
add al,32h
  
e.
mov si,0B9F6h
sub si,9874h
  
f.
mov cx,695Fh
sub cx,A218h
  

 

3. What will be the value of the Zero flag after each of the following instruction sequences has executed?

(notate: ZR = zero, NZ = not zero)

  
a.
mov ax,0FFFFh
add ax,1
  
b.
mov bh,2
sub bh,2
  
c.
mov dx,0
dec dx
  
d.
mov al,0DFh
add al,32h
  
e.
mov si,0B9F6h
sub si,9874h
  
f.
mov cx,695Fh
add cx,96A1h
  

 

4. What will be the value of the Sign flag after each of the following instruction sequences has executed?

(notate: PL = positive, NG = negative)

  
a.
mov ax,0FFFFh
sub ax,1
  
b.
mov bh,2
sub bh,3
  
c.
mov dx,0
dec dx
  
d.
mov ax,7FFEh
add ax,22h
  
e.
mov si,0B9F6h
sub si,9874h
  
f.
mov cx,8000h
add cx,A69Fh
  

 

5. What will be the values of the Carry, Sign, and Zero flags after the following instructions have executed?

(notate: CY/NC, PL/NG, ZR/NZ)

  
mov ax,620h
sub ah,0F6h
  

 

6. What will be the values of the Carry, Sign, and Zero flags after the following instructions have executed?

(notate: CY/NC, PL/NG, ZR/NZ)

  
mov ax,720h
sub ax,0E6h
  
  

 

7. What will be the values of the Carry, Sign, and Zero flags after the following instructions have executed?

(notate: CY/NC, PL/NG, ZR/NZ)

  
mov ax,0B6D4h
add al,0B3h
  
  

 

8. What will be the values of the Overflow, Sign, and Zero flags after the following instructions have executed?

(notate: OV/NV, PL/NG, ZR/NZ)

  
mov bl,-127
dec bl
  
  

 

9. What will be the values of the Carry, Overflow, Sign, and Zero flags after the following instructions have executed?

(notate: CY/NC, OV/NV, PL/NG, ZR/NZ)

  
mov cx,-4097
add cx,1001h
  
  

 

10. What will be the values of the Carry, Overflow, Sign, and Zero flags after the following instructions have executed?

(notate: CY/NC, OV/NV, PL/NG, ZR/NZ)

  
mov ah,-56
add ah,-60