; PFN.MAC VERS: 02.03 DATE: 06/10/87 TIME: 21:09 ; COPYRIGHT 1987 William P.N. Smith - Commercial use prohibited! ; ; print the name of the file you are pointing at. ; DE points to FCB or table entry, send filename.typ ; to the console. NULL EQU 00H ZERO EQU 00H PFN:: PUSH AF ;save all of the registers PUSH BC PUSH DE PUSH HL LD HL,SHWNAM ;point at the place we want to stuff the ASCII nae LD B,8 ;up to 8 chars dor the file name INC DE ;skip past the drive type FNLOOP: LD A,(DE) ;get the (next) byte RES 7,A ;7 bits only please CP ' ' ;is it a space? JR Z,EOFN ;yup, end of file name LD (HL),A ;else stuff it into the output buffer INC HL ;bump both pointers INC DE DJNZ FNLOOP ;do that up to 8 times EOFN: LD A,ZERO ;did count finish up yet? CP B JR Z,GETTYP ;yup, get the file type EFLOOP: INC DE ;bump the pointer DJNZ EFLOOP ;till end of file name GETTYP: LD (HL),'.' ;stuff in the dot INC HL LD A,(DE) ;get a byte RES 7,A LD (HL),A ;transfer it INC HL INC DE LD A,(DE) ;twice RES 7,A LD (HL),A INC HL INC DE LD A,(DE) ;three times RES 7,A LD (HL),A INC HL INC DE LD (HL),' ' ;terminate with ,NULL,'$' INC HL LD (HL),NULL INC HL LD (HL),'$' LD DE,SHWNAM ;send the string you just generated to the terminal CALL STROUT## POP HL ;recover all those registers and leave just the POP DE ;way you came in POP BC POP AF RET SHWNAM: DS 15 ;ascii file name lives here .REQUEST strout END