; DEBUGDUM.a ; ISUAL Debug functions ; "do nothing" version of DEBUG.a ; to get some more code space ; 26-July-2004 include debug.i include ioports.i include gbl.i DEBUG_DISABLE: debug_trap: out 0 ; force a reset jmp debug_trap ; =================== ; Initialization DEBUG_INIT: ; stuff all the interrupt vectors ; ; this will make jumps to 0000 do a Trap mvi a,JMP_OPCODE sta RST_0 ; 0 lxi h,DEBUG_TRAP shld RST_0+1 ; wild RST 7 is also a trap sta RST_7 shld RST_7+1 ; ; sta RST_0+4 ; 0.5 ; shld RST_0+5 ; ; sta RST_1 ; 1 ; shld RST_1+1 ; ; sta RST_1+4 ; 1.5 ; shld RST_1+5 ; ; sta RST_2 ; 2 ; shld RST_2+1 ; ; sta RST_2+4 ; 2.5 ; shld RST_2+5 ; ; sta RST_3 ; 3 ; shld RST_3+1 ; ; sta RST_3+4 ; 3.5 ; shld RST_3+5 ; ; sta RST_4 ; 4 ; shld RST_4+1 ; ; sta RST_4+4 ; shld RST_4+5 ; ; sta RST_5 ; 5 ; shld RST_5+1 ; ; sta RST_6 ; shld RST_6+1 ; ; sta RST_55 ; shld RST_55+1 ; ; sta RST_65 ; shld RST_65+1 ; ; sta RST_75 ; shld RST_75+1 ; ; set TRAP vector mvi a,JMP_OPCODE ; JMP opcode sta TRAP lxi h,DEBUG_TRAP ; address of Trap handler shld TRAP+1 ; set as JMP address ret ; DEBUG_PUTBYTE: ret DEBUG_SHOW: ret DEBUG_DUMP: ret DEBUG_SHOWUT: ret DEBUG_SHOWA: ret DEBUG_REGSET: ret DEBUG_ASC: ; text follows call: look for '$' or '~' in following string ; (don't show '~' or '$') xthl ; exchange top of stack (TOS) with HL push psw a1: mov a,M ; get string byte cpi '$' ; end of string? jz a2 ; yes cpi '~' ; end with no newline? jz a2nl call DEBUG_PUTBYTE ; no send out byte inx h ; keep looking jmp a1 a2: mvi a,10 ; send Newline call DEBUG_PUTBYTE a2nl: inx h pop psw xthl ; set new return-address as TOS ret ; DEBUG_ASC_HL: ; HL - data value to display in Hex ; text follows call: look for '=' in following string xthl ; exchange top of stack (TOS) with HL push psw stl1: mov a,M ; get string byte ch3: call DEBUG_PUTBYTE ; send it out cpi '=' ; end of string? jz found_eq ; yes inx h ; no; keep looking jmp stl1 found_eq: inx h pop psw xthl ; set new return-address as TOS ret ; DEBUG_ASC_DEC: ; HL - data value to display in decimal ; text follows call: look for '=' in following string xthl ; exchange top of stack (TOS) with HL push psw ttl1: mov a,M ; get string byte call DEBUG_PUTBYTE ; send it out cpi '=' ; end of string? jz fnd_eq ; yes inx h ; no; keep looking jmp ttl1 fnd_eq: inx h pop psw xthl ; set new return-address as TOS ret