You are on page 1of 2

1. increment a 8 bit number 8. 2's complement of a 16-bit number.

MOV AL, 05H ;Move 8-bit data to AL MOV AX, 0005H ;Move 16-bit data to AL.
INC AL ;Increment AL NEG AX ; 2’S Complement OF AX.
HLT ;Halt
HLT ;Halt
2 increment a 16 bit number
9. Add two 8-bit numbers.
MOV AX, 0005H ;Move 16-bitdatatoAX
MOV AL, 05H ;Move 1 8-bit number to AL.
INC AX ;Increment AX
MOV BL, 03H ;Move 2nd 8-bit number to BL.
HLT ;Halt
ADD AL, BL ;Add BL with AL.
3 decrement a 8 bit number
HLT ;Halt
MOV AL, 05H ;Move 8-bit data to AL
10. Add two 16-bit numbers.
DEC AL;Decrement AL
MOV AX, 0005H ;Move 1st 16-bit number to AX.
HLT ;Halt
MOV BX, 0003H ;Move 2nd 16-bit number to BX.
4 decrement a 16 bit number
ADD AX, BX ;Add BX with AX.
MOV AX, 0005H ;Move 16-bit data to AX
HLT ;Halt
DEC AX ; decrement AX.
11 Subtract two 8-bit numbers.
HLT ;Halt
MOV AL, 05H ;Move 1st 8-bit number to AL.
5. 1's complement of an 8-bit number.
MOV BL, 03H ;Move 2nd 8-bit number to BL.
MOV AL, 05H ;Move 8-bit data to AL.
SUB AL, BL ;Subtract BL from AL.
NOT AL ;Complement AL
HLT
HLT ;Halt
12 Subtract two 16-bit numbers.
6. 1's complement of an 16-bit number.
MOV AX, 0005H ;Move 1st 16-bit number to AX.
MOV AX, 0005H ;Move 16-bit data to AX.
MOV BX, 0003H ;Move 2nd 16-bit number to BX.
NOT AX ;Complement AX
SUB AX, BX ;Subtract BX with AX.
HLT ;Halt
HLT ;Halt
7. 2's complement of an 8-bit number.
LOGICAL PROGRAMS
MOV AL, 05H ;Move 8-bit data to AL. Program 13. 8 BIT AND PROGRAM
X Y AND
NEG AL ; 2’S Complement AL 0 0 0
0 1 0
HLT ;Halt 1 0 0
1 1 1
MOV AL, 04H MOV AL,04H

MOV BL, 02H MOV BL,02H

AND AL, BL XOR AL,BL

HLT HLT

Program 14. 16 BIT AND PROGRAM Program 18. 16 BIT XOR PROGRAM

MOV AX,0004H MOV AX,0004H

MOV BX,12ABH MOV BX,12ABH

AND AL,BL XOR AL,BL

HLT HLT

Program 15. 8 BIT OR PROGRAM SHIFT PROGRAMS

X Y OR 19.SHIFT LEFT - MOV AL,02H


0 0 0
0 1 1 SHL AL,2
1 0 1
1 1 1 HLT

MOV AL,04H 20.SHIFT RIGHT- MOV AL,22H

MOV BL,02H SHR AL, 2

OR AL,BL HLT

HLT ROTATION PROGRAMS

Program 16. 16 BIT OR PROGRAM 21. RCR RIGHT ROTATION WITH CARRY

MOV AX,0004H MOV AL,05H

MOV BX,12ABH RCR AL,02

OR AL,BL HLT

HLT 22. RCL LEFT ROTATION WITH CARRY

Program 17. 8 BIT XOR PROGRAM MOV AL,05H

X Y XOR RCL AL,02


0 0 0
0 1 1 HLT
1 0 1
1 1 0

You might also like