Quick question, as the title implies. I'm in the process of writing an 'OS' for my DIY Z80 computer and one of the things I need to do to help debug any issues during the boot process is send a repeating sequence of data to an IO port in the event of a problem.
The problem I'm catering for is a very specific one where there is no RAM present - obviously this means no stack, either.
So what can I get away with in terms of program structure with no stack? I'm assuming a simple JP instruction and most opcodes that aren't CALL should work?
The code below doesn't seem to get executed - though this could be a problem specific to the failure mode of my setup, I just wanted to confirm that the code below will work with no stack?
Here's the error routine:
BOOT_ERROR: LD A,C ; Move error code into E LD E,A ; LD A,%10101010 ; Load HALT code into L LD L,A bterr_lp: LD A,L ; Get code to display OUT (BASIC_IO),A ; Update error display LD BC,$FFFF ; Set delay (1 sec approx.) bterr_plp: NEG ; 8 T-states NEG ; 8 T-states NEG ; 8 T-states NEG ; 8 T-states DEC BC ; 6 T-states LD A,C ; 9 T-states OR B ; 4 T-states JP NZ,bterr_plp ; 10 T-states EX DE,HL ; Swap error code with HALT code JP bterr_lp