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:
©Dixit Bhatta 2013
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
MVI C, D
ReplyDeleteMVI B, 0
wrong code solve it first
Hi Adhir,
DeleteCan you explain a bit more? This runs perfectly in my 8085 simulator.
it should be MOV not MVI
DeleteMVI C, D
ReplyDeletenot needed ...!!!
MVI C D
ReplyDeleteMVI B 0
i dont think they are correct !!!
That's MVI C,00
ReplyDeleteThat's MVI C,00
ReplyDelete