Professional Documents
Culture Documents
: 1b Date:19-01-2024
Aim:
To perform 16 bit arithmatic operation namely addition and subtraction using Keil
uVision software.
Program:
1. Addition:
MOV A, # 83h
MOV B, # 94h
ADD A,B
MOV R0,A
MOV A,0CAh
MOV B,0ABh
ADDC A,B MOV R1,A JNCL
INC R2
L:
END
Input:
A = CA83H
B = AB94H
Output:
R0 =0*17
R1=0*76
R2=0*01
2. Subtraction:
MOV A, # 07h
MOV B, # 05h
1
SUBB A,B
MOV R0,A
MOV A,0CAH
MOV B,0ABH
SUBB A,B
MOV R1,A
JNC L
INC R2
L:
END
Input:
A = CA83H
B = AB94H
Output:
R0=0*EF
R1=0*1E
R2=0*00
2
3
4
5
Result:
We understood how to append or assign values to the the registers present on 8051
microprocessor and perform 16 bit addition and subtraction operation on these stored values
in the variables. Also, learned how to reflect the carry/borrow present in the result with
help of JNC and INC function and hence successfully completed the programs to perform
arithmetic operations using assembly language.