;---------------------------------------------------------------- ; This is a module in the PL/I-80 utility library ; ; This module must print 080 of memory pointed to by a PL/I pointer ; ; Written By Richard Holmes 09-12-84 ; Last update Richard Holmes 09-12-84 ;---------------------------------------------------------------- ; name 'pbuff' public pbuff extrn getp2 ; maclib z80 bdos equ 5 cr equ 0dh lf equ 0ah ; pbuff: lxi d,1000h call getp2 ; fetch the pointer xchg ; load into HL mvi b,8 ; lines mvi c,0 pbuff1: call crlf mov a,c call dsp$hex call space2 call pline mov a,c adi 16 mov c,a ; update the address field lxi d,16 dad d ; -> next memory djnz pbuff1 ret ; pline: push b push h mvi b,16 ; 16 hex bytes pl1: mov a,m call dsp$hex ; display hex byte call space mov a,b cpi 9 jrnz pl2 mvi a,'-' call conout call space pl2: inx h ; next memory address djnz pl1 call space3 pop h push h ; Do the ascii now mvi b,16 pl3: mov a,m cpi 07eh jnc not$asc cpi ' ' jnc na1 ; print as ascii ; not$asc: mvi a,'.' na1: call conout inx h djnz pl3 ; pop h pop b ret ; ; Display A as a double hex digit ; dsp$hex: push psw ani 0f0h ; mask off bottom rar rar rar rar call nib$asc call conout pop psw ani 0fh call nib$asc jmp conout ; nib$asc: ani 0fh adi 090h daa aci 040h daa ret ; crlf: mvi a,cr call conout mvi a,lf jr conout space3: mvi a,' ' call conout space2: mvi a,' ' call conout space: mvi a,' ' conout: push h push d push b mov e,a mvi c,02 ; output function call bdos pop b pop d pop h ret