; PUTZFS - Deparse FCB to DU:FN.FT ;Translates FCB preceded by a byte containing the user ;number into the standard FileSpec format, DU:FN.FT . ;PUTZDU sends DU: to a 3-byte destination ;PUTZFN sends FN.FT to a 12 byte buffer ;PUTZFS sends DU:FN.FT to a 15 byte buffer ;Spaces in FN are moved to the end of dest buffer. ;The space count returned in C excludes terminal ;spaces in FT, so that FT will not be shortened by ;justification ;CALL WITH: ; HL -> FCB+1 (FILENAME field) ; DE -> destination buffer ;RETURN WITH: ; A destroyed, B = 0 ; C = number of fill spaces at buffer end ; DE -> next unused buffer location ; HL -> FCB+12 ext mafdc ;from SYSLIB public putzfs,putzdu,putzfn putzfs: call putzdu ld a,':' ;send the colon separator ld (de),a inc de putzfn: ld bc,080bh ;b=max fn char, c=max fn+ft char call putfs1 ;hl-> ft field ld a,'.' ;send the fn terminator ld (de),a inc de ;send the file type (FT) ldi ldi ldi inc c dec c ;zero? ret z ;return if so, else... ld b,c ;put the count in B, and.. ld a,' ' fill: ld (de),a ;fill remainder of dest with blanks inc de ;and return to caller djnz fill ret ;send b bytes, ignoring spaces putfs1: ld a,(hl) ;get the byte inc hl ;-> next byte cp ' ' ;space? jr z,putfs2 ;skip if yes ld (de),a dec c ;count characters transferred inc de putfs2: djnz putfs1 ret putzdu: push hl dec hl ld a,(hl) add 'A'-1 ;convert to (A..P) ld (de),a inc de ;send the Drive letter dec hl ;-> user number ;convert the user number to ASCII decimal & send ld a,(hl) call mafdc ;convert to ascii at DE ;send the file name (FN) pop hl ;-> FCB+1 (file name field) ld bc,0 ;b=0, c=0 (no unfilled bytes) ret ;=================================================