Professional Documents
Culture Documents
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
HLT HLT
Program 14. 16 BIT AND PROGRAM Program 18. 16 BIT XOR PROGRAM
HLT HLT
OR AL,BL HLT
Program 16. 16 BIT OR PROGRAM 21. RCR RIGHT ROTATION WITH CARRY
OR AL,BL HLT