; SHOWSUBS.Z80 ; Position Display at INFOXY address and advance dispxy: push hl push af ld hl,(infoxy) ; Get screen position call gotoxy ; Go there inc h ; Advance to next line ld (infoxy),hl ; Set screen position pop af pop hl ret ;----------------------------------------------------------------------------- ; Subroutine to position cursor and print string at return address vprxy: call dispxy jp vprint ;----------------------------------------------------------------------------- ; Print 'YES' if A is nonzero; else print 'NO' pryna: or a ; Set flags based on A ; If flag NZ, print 'YES'; else print 'NO' pryn: jr nz,pryes call print defb 'NO',0 ret pryes: call print defb 'YES',0 ret ;----------------------------------------------------------------------------- ; Subroutine to display one line (16 bytes) of memory. On entry HL points to ; the starting address. dumpline: ld (cline),hl ; Set pointer to start address of line ld b,16 ; Count for columns dump1: ld a,b ; Extra space every four columns and 3 ld a,' ' ; Extra space call z,cout ld a,(hl) ; Get next byte call pa2hc ; Print as hex inc hl ; Point to next byte ld a,' ' call cout djnz dump1 call print defb '| ',0 ld hl,(cline) ; Start with beginning address of line again ld b,16 ; Column count again dump2: ld a,(hl) ; Get next byte and 7fh ; Mask MSB cp ' ' ; See if it is printable jr nc,dump3 ; If so, branch ld a,'.' ; Else fill with dot dump3: call cout inc hl ; Point to next byte djnz dump2 ; Loop through all 16 ret ; End SHOWSUBS.Z80