FYI! This is for a school project. I just need some guidance as my instructor seems uninterested.
I have to write some code for the Z80 that will execute two instructions then copy those instructions to 2000H then goto 2000H and execute those instructions there then return to the original program and delete the instructions that were copied to 2000H
Here is what we start with:
I have to replace the NOP's with the new instructions.
Here is where I am:
My problem is after copying the opcode to 2000H and 2001H and then going there using ORG 2000H, I dont know how to make the instructions in that memory actually execute before returning to 180EH.
Can anyone give me a little insight or just slap me in the head and tuen me in the right direction if this is all wrong?
Thanks
Aldo
I have to write some code for the Z80 that will execute two instructions then copy those instructions to 2000H then goto 2000H and execute those instructions there then return to the original program and delete the instructions that were copied to 2000H
Here is what we start with:
Rich (BB code):
ORG 1800H
ADD A,B
ADD A,C
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
HALT
Here is where I am:
Rich (BB code):
ORG 1800H
ADD A,B
ADD A,C
LD A,(1800H)
LD (2000H),A
LD A,(1801H)
LD (2001H),A
ORG 2000H
ORG 180EH
LD A,00H
LD (2000H),A
LD (2001H),A
HALT
Can anyone give me a little insight or just slap me in the head and tuen me in the right direction if this is all wrong?
Thanks
Aldo