Sunday, September 13, 2009

HEX to binary conversion(8085)

Statement: Convert an 8 bit hex no to its binary form & store in memory.

Source Program:

LXI H, 4150 : Initialize memory pointer
MVI B, 08 : count for 8-bit
MVI A, 54
LOOP : RRC
JC LOOP1
MVI M, 00 : store zero it no carry
JMP COMMON
LOOP2: MVI M, 01 : store one if there is a carry
COMMON: INX H
DCR B : check for carry
JNZ LOOP
HLT : Terminate the program

1 comment:

  1. LOOP2 will be replaced by LOOP1 or vice versa

    ReplyDelete