home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ZSYS / SIMTEL20 / SYSLIB / SLIB3.LBR / SMFN3.Z80 < prev    next >
Text File  |  2000-06-30  |  1KB  |  55 lines

  1. ;
  2. ; SYSLIB Module Name:  SMFN3
  3. ; Author:  Richard Conn
  4. ; SYSLIB Version Number:  3.6
  5. ; Module Version Number:  1.1
  6.  
  7.     public    mfn3
  8.  
  9. ;
  10. ;  Print FCB file name and type pted to by DE to memory pted to by HL
  11. ;  Format of Output:  xxxxxxxx.yyy <spaces> (0-8 x's, 0-3 y's, req'd spaces)
  12. ;
  13. mfn3:
  14.     push    hl    ; save regs
  15.     push    de
  16.     push    bc
  17.     push    af
  18.     ld    c,11    ; 11 chars total
  19.     ld    b,8    ; 8 chars first
  20.     call    prfnx
  21.     ld    (hl),'.'
  22.     inc    hl
  23.     ld    b,3    ; 3 more chars
  24.     call    prfnx
  25.     ld    a,c    ; get count of spaces
  26.     or    a    ; 0=none
  27.     call    nz,spacer
  28.     pop    af    ; restore regs
  29.     pop    bc
  30.     pop    de
  31.     pop    hl
  32.     ret
  33. prfnx:
  34.     ld    a,(de)    ; get char
  35.     and    7fh    ; mask out msb
  36.     cp    ' '    ; skip space
  37.     call    nz,prout    ; print it
  38.     inc    de    ; pt to next
  39.     dec    b    ; count down
  40.     jp    nz,prfnx
  41.     ret
  42. prout:
  43.     ld    (hl),a    ; store char
  44.     inc    hl    ; pt to next
  45.     dec    c    ; count chars
  46.     ret
  47. spacer:
  48.     ld    (hl),' '    ; space over
  49.     inc    hl
  50.     dec    c    ; count down
  51.     jp    nz,spacer
  52.     ret
  53.  
  54.     end
  55.