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 / CPM / BDOS / DOSPLSOR.ARK / LIST.MAC < prev    next >
Text File  |  1987-02-01  |  1KB  |  73 lines

  1. ; list file on printer, no translations of any kind.
  2. ; Used to emit graphics files.
  3. ;
  4. bdos    equ    5
  5. fcb    equ    05ch
  6. dbuf    equ    080h
  7. ;
  8. @lout    equ    5
  9. @tstr    equ    9
  10. @fopen    equ    15
  11. @fread    equ    20
  12. ;
  13.     org    0100h
  14. ;
  15. list:    lxi    h,0
  16.     dad    sp
  17.     lxi    sp,stack
  18.     push    h
  19.     lxi    d,fcb
  20.     mvi    a,@fopen
  21.     call    dos
  22.     inr    a
  23.     jz    nofile;        not found
  24.     lxi    h,dbuf
  25. ;    "    "
  26. ; de is ^file, hl is i/o pointer
  27. list1:    mvi    a,@fread
  28.     call    dos
  29.     jnz    exit;        physical eof
  30.     call    dump
  31.     jmp    list1
  32. ;
  33. nofile:    lxi    d,msg
  34.     mvi    a,@tstr
  35.     call    dos
  36. ;    "    "
  37. exit:    pop    h
  38.     sphl
  39.     ret
  40. ;
  41. ; dump buffer hl^ to list, assumed at defdma
  42. ; a,f
  43. dump:    push    h
  44.     push    d
  45. dump1:    mov    e,m
  46.     mvi    a,@lout
  47.     call    dos
  48.     inr    l
  49.     jm    dump1;        not end of buffer
  50.     pop    d
  51.     pop    h
  52.     ret
  53.  
  54. ; Dos call a
  55. ; a,f
  56. dos:    push    b
  57.     push    d
  58.     push    h
  59.     mov    c,a
  60.     call    bdos
  61.     ora    a
  62.     pop    h
  63.     pop    d
  64.     pop    b
  65.     ret
  66. ;
  67. msg:    db    'Not found. Usage: "LIST fn.ft"$'
  68. ;
  69.     ds    48
  70. stack:
  71.     end
  72.  
  73. àI