BINARY TO BCD CONVERSION

WRITE THIS IN THE WRITING SIDE OF THE JOURNAL

ADDRESSOPCODELABELMNEMONICSCOMMENT
400021 50 40LXI H,4050H;set memory pointer to HL
40037EMOV A,M;move mem. to acc.
400423 INX H;increment HL address
400506 64MVI B,64H;set reg B = 64H
400736 FFMVI M,0FFH;set reg. E=0FFH
400934UP:INR M;increment memory data
400A90SUB B;subtract A – B
400BD2 09 04JNC UP;jump to UP
400E80ADD B;add A + B
400F23INX H;increment HL address
401006 0AMVI B,0AH;load B = 0AH
401236 FFMVI M,0FFH;load mem. =0FFH
401434UP1:INR M;increment memory data
401590SUB B;subtract A – B
4016D2 14 40JNC UP1;jump to UP1
401980 ADD B;add A + B
401A23INX H;increment HL address
401B77MOV M,A;move mem. to acc.
401C76HLT;entering 8085 in halt state

) Sign Flag is reset: Result is positive
) Zero flag is set: result is set to zero after the execution of arithmetic or logical operation
) auxiliary carry flag is set: there is a carry from bit D3 to D4
) parity flag is set: result stored in accumulator contain even number of 1’s
) carry flag is result: no carry or borrow bit during the execution of arithmetic operation

WRITE THIS IN THE BLANK SIDE OF THE JOURNAL

Scroll to Top