User`s guide

; sample file-to-file copy program
; at the ccp level , the command
; copy a:x.y b:u.v
; copies the file named x.y from drive
; a to a file named u.v on drive b.
0000 = boot equ 0000h ; system reb00t
0005 = bdos equ 0005h ; bdos entry P0int
005c = fcbl equ 00Sch ; first file name
005c = sfcb equ fcbl ; source fcb
006c = fcbZ equ 00Bch ; second file name
0080 = dbuff equ 0080h ; default buffer
0100 = tpa equ 0100h ; beginning 0f tpa
0003 = printf equ 9 ; Print buffer func*
000f = openf equ 15 ; Open file func*
0010 = closef equ 16 ; close file func*
0013 = deletef equ 19 ; delete file func*
0014 = readf equ 20 ; sequential read
0015 = writef equ 21 ; sequential write
0016 = makef equ 22 ; make file func*
;
0100 org tpa ; beginning of tpa
0100 311b02 lxi sp,stack; local stack
;
; move second file name to dfcb
0103 0el0 mvi c,16 ; half an fcb
0105 116c00 lxi d,fcb2 ; source of move
0108 2lda0l lxi h,dfcb ; destination fcb
0l0b la mfcb: ldax d ; source fcb
0l0c 13 inx d ; ready next
0l0d 77 m0v m,a ; dest fcb
0l0e 23 inx h ; ready next
0l0f 0d dcr c ; count l6...0
0110 c20b0l jnz mfcb ; loop 16 times
; name has been moved, zero cr
0113 af xra a ; a = 00h
0114 32fa01 sta dfcbcr ; current rec = 0
4-1
4.1 A Sample Copy Program CP/M 3 Programmer's Guide