; TITLE "SMFN2 - Syslib 4.0" NAME ('MFN2') ;================================================================= ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from SMFN2.Z80 by Richard Conn ; Date : 17 Sep 89 ; Version : 1.2 ; Module : SMFN2 ; Abstract: This module contains the routine MFN2 which prints a ; File Name and Type which is in Fixed-format FCB form to ; a Memory location in a variable-length field, deleting ; spaces. Most significant bits of each character are ; masked off. The format of the output is: xxxxxxxx.yyy, ; where the name field consists of from 0 to 8 characters ; (0-8 x's) and the type is from 0 to 3 characters (0-3 y's). ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC MFN2 .Z80 CSEG ;=============================================================== ; NAME - MFN2 ; Entry: DE - Points to the first character of an FCB filename ; HL - Points to 12-character memory buffer ; Exit : - No parameters returned, the filename is copyed to Memory ; Uses : - None ; Special Requirements: None ;=============================================================== MFN2: PUSH BC ; Save the BC register PUSH HL ; save regs PUSH DE PUSH AF LD B,8 ; 8 chars first CALL PRFNX LD (HL),'.' ; Store period in memory INC HL ; ..and bump pointer LD B,3 ; 3 more chars CALL PRFNX POP AF ; restore regs POP DE POP HL POP BC RET PRFNX: LD A,(DE) ; get char AND 7FH ; mask out msb CP ' ' ; space? JR Z,PRFNX9 ; Bypass output if space LD (HL),A ; Stash char in memory INC HL ; ..and bump pointer PRFNX9: INC DE ; pt to next DJNZ PRFNX ; count down RET END