home *** CD-ROM | disk | FTP | other *** search
- ; list file on printer, no translations of any kind.
- ; Used to emit graphics files.
- ;
- bdos equ 5
- fcb equ 05ch
- dbuf equ 080h
- ;
- @lout equ 5
- @tstr equ 9
- @fopen equ 15
- @fread equ 20
- ;
- org 0100h
- ;
- list: lxi h,0
- dad sp
- lxi sp,stack
- push h
- lxi d,fcb
- mvi a,@fopen
- call dos
- inr a
- jz nofile; not found
- lxi h,dbuf
- ; " "
- ; de is ^file, hl is i/o pointer
- list1: mvi a,@fread
- call dos
- jnz exit; physical eof
- call dump
- jmp list1
- ;
- nofile: lxi d,msg
- mvi a,@tstr
- call dos
- ; " "
- exit: pop h
- sphl
- ret
- ;
- ; dump buffer hl^ to list, assumed at defdma
- ; a,f
- dump: push h
- push d
- dump1: mov e,m
- mvi a,@lout
- call dos
- inr l
- jm dump1; not end of buffer
- pop d
- pop h
- ret
-
- ; Dos call a
- ; a,f
- dos: push b
- push d
- push h
- mov c,a
- call bdos
- ora a
- pop h
- pop d
- pop b
- ret
- ;
- msg: db 'Not found. Usage: "LIST fn.ft"$'
- ;
- ds 48
- stack:
- end
-
- àI