Addition of two 8 bit numbers using 8051
In this post, we will see how to perform the addition of two 8 bit numbers using 8051 instruction set.
ALGORITHM: Addition of two 8 bit numbers using 8051
- Clear C – register for Carry
- Get the data immediately .
- Add the two data
- Store the result in memory pointed by DPTR
Programming using 8051
ORG 4100
CLR C
MOV A,#data1
ADD A,#data2
MOV DPTR,#4500
MOVX @DPTR,A
HERE: SJMP HERE
Observation
Input:
66
23
Output:
89 (4500)
Conclusion
Thus the program to perform addition of two 8 bit numbers using 8051 instruction set was executed.