; Memory page 0 dump in hex program by Barry A. Cole 870415 ; This program can be used to look at key variables such as the BDOS ; entry(locations 6 and 7), the BIOS warm boot address(2 & 3), ; the IOBYTE(3), the deault disk buffer(80-ff), and the current drive ; and user number(4). ; You can explore the command tail buffer(80+) and the default file ; control blocks(5C+ & 6C+). This allows passing command line ; arguments and seeing the effect on the FCB's. ; Usage: ; A0>page0 ; A0>page0 b:*.* xyz.doc ; B5:page0 ??? command tail bdos equ 0005h ;dos entry point cr equ 0dh ;carriage return lf equ 0ah ;line feed org 100h start: call crlf lxi d,howdy mvi c,9 ;message to console call bdos lxi h,0 ;hl contains next address to print gloop: mov a,l ;check for line fold ani 0fh ; by low 4 bits jnz nonum call crlf ;print line number mov a,h call phex mov a,l call phex nonum: mvi a,' ' call pchar mov a,m call phex mov a,l ani 0fh cpi 0fh jnz more ;end of line so dispay ascii mvi a,' ' call pchar mvi a,' ' call pchar mov a,l ani 0f0h ;beginning of line mov l,a ascii: mov a,m cpi 7fh ;printable? jnc dot ; no cpi ' ' ;printable? jnc notctl ; yes dot: mvi a,'.' ;substitute dot for unprinable notctl: call pchar inr l mov a,l ani 0fh jnz ascii dcr l more: inx h ;to next line number mvi a,1 cmp h rz ;done, back to cp/m jmp gloop ; crlf: mvi a,cr call pchar mvi a,lf ;print a character from register a pchar: push h! push d! push b; saved mvi c,2 ;character to console mov e,a call bdos pop b! pop d! pop h; restored ret ; phex: ;print hex char in reg a push psw rrc rrc rrc rrc call pnib ;print nibble pop psw ;print nibble in reg a pnib: ani 0fh ;low 4 bits cpi 10 jnc p10 ; less than or equal to 9 adi '0' jmp prn ; greater or equal to 10 p10: adi 'A' - 10 prn: jmp pchar ; howdy: db 'Dump of memory page 0 by Barry A. Cole 870415' db 0dh,0ah,'$' end start