Saturday, April 30, 2016

8051 Program – addition 8bit 2digit bcd

;addition of 8bit 2 digit bcd numbers
;R5 = R1+R2
ORG 0H
BCD_1 EQU 20H
BCD_2 EQU 90H
MAIN:
MOV R1,#BCD_1
MOV R2,#BCD_2
LCALL BCDADD
SJMP MAIN
BCDADD:
MOV A,R1
ADD A,R2
DA A
MOV R5,A
RET
END



Related topics:
8051 Program - arithmetic operation 8bit   |   8051 Program - addition 8bit   |   8051 Program - subtraction 8bit   |   8051 Program - multiplication 8bit   |   8051 Program - division 8bit   |   8051 Program - addition 16bit   |   8051 Program - subtraction 16bit   |   8051 Program - multiplication 16bit   |   8051 Program - division 16bit   |   8051 Program - addition multibyte   |   8051 Program - multiplication 16bit by 8bit   |   8051 Program - memory subroutines   |   8051 Program - math subroutines   |   8051 Program - conversion subroutines

List of topics: 8051

No comments:

Post a Comment