Having fixed the bug that prevented the loading program from working, I have now successfully assembled a short Z80 program and run it in memory.
;Z80 Test Program
DESTINATION_SIZE equ 50
.org 0000h
start:
LD HL, Storea ; point to the source
LD DE, Storea + 1 ; point to the destination
LD BC, DESTINATION_SIZE - 1 ; copying this many bytes
LD (HL), 170 ; put a value in the 1st pos
LDIR ; move 1 to 2, 2 to 3...
Finish:
NOP
NOP
NOP
NOP
JP Finish ;Infinite Loop
Storea:
DEFS 50
end
A nice easy memory filler. I tested it by temporarily redirecting a reading routine in the AVR to check the bytes after the code (Storea). All seems well. More experimentation to come.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.