Hi all,
I'm writing a simple program to test my ram memory of the my z80 small computer. I write this assembly code:
Code:
On 02H IO address I have connected a simple LED display.
But when I run this program the display show 7EH that is the opcode of the instruction: LD A,(HL) instead of 04H.
Why this???
Code:
please let me know.
thanks rohs
I'm writing a simple program to test my ram memory of the my z80 small computer. I write this assembly code:
Code:
LD HL,5000H
LD (HL),04H
LD A,(HL)
loop: OUT (02H),A
jr loop
On 02H IO address I have connected a simple LED display.
But when I run this program the display show 7EH that is the opcode of the instruction: LD A,(HL) instead of 04H.
Why this???
Code:
DISASSEMBLER LISTING:
0001 0000 21 00 50 LD HL,5000H
0002 0003 36 04 LD (HL),04H
0003 0005 7E LD A,(HL)
0004 0006 D3 02 L0001: OUT (02H),A
0005 0008 18 FC JR L0001
please let me know.
thanks rohs