Sunday, 28 April 2013

8085 program to convert 8-bit binary to BCD

LXI H, 8D02
MOV A, M
MVI C, D
MVI B, 0

HUN:
SUI 64H
JC TENS
INRC
JMP HUN

TENS:
ADI 64H

LOOP:
SUI 0AH
JC UNITS
INR B
JMP LOOP

UNITS:
ADI 0AH

INX H
MOV M,C
INX H
MOV M,B
INX H
MOV M,A
HLT

Observation:

Memory
Content
Input
8D02H
8D
Output
8D21H
01
8D22H
04
8D23H
01

©Dixit Bhatta 2013

7 comments:

Was this post helpful? Ask any questions you have, I will try to answer them for you.

Follow by Email