Write an 8085 assembly language program to convert binary to bcd
Answers
Answered by
1
8085 program to convert a BCD number to binary
Problem – Write an assembly language program for converting a 2 digit BCD number to its binary equivalent using 8085 microprocessor.
Examples:
Input : 72H (0111 0010)2
Output : 48H (in hexadecimal) (0011 0000)2
((4x16)+(8x1))=72
Algorithm:
Load the BCD number in the accumulator
Unpack the 2 digit BCD number into two separate digits. Let the left digit be BCD1 and the right one BCD2
Multiply BCD1 by 10 and add BCD2 to it
If the 2 digit BCD number is 72, then its binary equivalent will be
7 x OAH + 2 = 46H + 2 = 48H
Similar questions