PhysicsTeacher.in

High School Physics + more

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

  1. Clear C – register for Carry
  2. Get the data immediately .
  3. Add the two data
  4. 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.

See also  Interrupt Vector Table in 8086
Scroll to top
error: physicsTeacher.in