; module name: zpdufn ; author: Terry Hazen ; date: 03/14/91 ; ZPDUFN provides several routines designed to display on the console ; the du:, filename and filetype in a standard ZCPR3 fcb. ; public zprdfn,zprfn,zprft,dispfn,dispft ext cout ; ; basic equates ; bdos equ 5 ; ; ZPRDU - displays the du:filename.typ in the fcb pointed to by DE. ; ; Entry: DE points to fcb ; Uses: AF,BC,HL ; zprdfn: push hl ; Save registers push de ld a,(de) ; Get drive or a ; Default? jr nz,dispdr ; No, go display it ; ld c,25 ; Get current drive call bdos inc a ; Make it A=1 ; dispdr: add '@' ; Make it ASCII call cout ; Display it ; pop de ; Restore fcb pointer ld hl,13 ; Point to user number add hl,de ld a,(hl) ; Get user number and 7fh ; Filter hi bit ; ld b,'0'-1 ; Preset counter cp 10 ; Single digit? jr c,putcln ; Yes, display single digit ; prndu1: inc b ; Count tens digit in B sub 10 ; Keep subtracting 10 until CARRY is set jr nc,prndu1 ; add a,10 ; Get remainder (units digit) back ld c,a ; Save it in C ld a,b ; Get tens digit call cout ld a,c ; Get units digit ; putcln: add a,'0' ; Convert to ASCII call cout ; ld a,':' ; Add colon call cout pop hl ; Restore registers and fall thru ; ; ZPRFN - displays the filename.typ in the fcb pointed to by DE. ; ; Entry: DE points to fcb ; Uses: AF,BC,HL ; zprfn: push de ; Pointer in HL pop hl inc hl ; Point to filename ; ld b,8 call dispfn ; ; ZPRFT - displays the filetyp in the fcb pointed to by DE. ; ; Entry: DE points to fcb ; Uses: AF,BC,HL ; zprft: ld hl,9 add hl,de ; Point to file type ld a,(hl) cp ' ' ret z ; No file type, we're done, else fall thru ; ; DISPFT - displays a colon and the string pointed to by HL for a max ; of 3 bytes, quitting at the first space. ; ; Entry: HL points to string ; Exit: HL points to byte following last byte displayed ; Uses: AF,BC,HL ; dispft: ld a,'.' ; Display colon call cout ; ld b,3 ; Fall thru to display filetype ; ; DISPFN - displays the string pointed to by HL for a max of B bytes, ; quitting at the first space. ; ; Entry: HL points to string ; Exit: HL points to byte following last byte displayed ; Uses: AF,BC,HL ; dispfn: ld a,(hl) and 7fh ; Filter hi bit inc hl or a ; End? ret z ; Yes ; cp ' ' ; End? ret z ; call cout djnz dispfn ret end