User`s guide

; system interface subroutines
; (all return directly from bdos)
0169 0e0f open: mvi c ,openf
016b c30500 Jmp bdos
016e 0el0 close: mvi c,closef
0170 c30500 Jmp bdos
0173 0e13 delete: mvi c ,deletef
0175 c30500 Jmp bdos
0178 0e14 read: mvi C ,readf
017a c30500 Jmp bdos
017d 0e15 write: mvi c ,writef
017f c30500 Jmp bdos
0182 0e16 maKe: mvi c,makef
0184 c30500 Jmp bdos
; console messages
0187 6e6f20f nofile: db 'no source file$'
0196 6e6f209 nodir: db 'no directory space$'
01a9 5f7s74f space: db 'out of data space$'
0lbb 7772695 wrprot: db 'write protected?$'
0lcc 636f700 normal: db 'copy complete$'
; data areas
0lda dfcb: ds 33 ; destination fcb
0lfa = dfcbcr equ dfcb+32 ; current record
0lfb ds 32 ; 16 level stack
stack:
021b end
Note that this program makes several simplifications and could be enhanced. First,
it does not check for invalid filenames that could, for example, contain ambiguous
references. This situation could be detected by scanning the 32-byte default area
starting at location 005CH for ASCII question marks. To check that the filenames
have, in fact, been included, COPY could check locations 005DH and 006DH for
nonblank ASCII characters. Finally, a check should be made to ensure that the source
and destination filenames are different. Speed could be improved by buffering more
data on each read operation. For example, you could determine the size of memory
by fetching FBASE from location 0006H, and use the entire remaining portion of
memory for a data buffer. You could also use CP/M 3's Multi-Sector I/O facility to
read and write data in up to 16K units.
4-4
4.1 A Sample Copy Program CP/M 3 Programmer's Guide