To perform addition of two 8 – bit numbers using 8051 instruction set.
ALGORITHM:
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
PROGRAM:
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)
ALGORITHM:
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
PROGRAM:
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)
Addition of 8 – bit numbers using 8051 instruction set
Reviewed by enakta13
on
August 24, 2012
Rating: