* FCOPY.S FILE COPY UTILITY text link a6,#0 movea.l 8(a6),a0 lea $5c(a0),a1 move.l a1,fcb1 lea $38(a0),a1 move.l a1,fcb2 move #15,d0 * open source file move.l fcb1,d1 trap #2 cmpi.w #$ff,d0 bne ok1 move.l #err1,d1 bra err ok1: movea.l fcb1,a0 clr.b 32(a0) move #19,d0 * delete destination file move.l fcb2,d1 trap #2 move #22,d0 * open destination file move.l fcb2,d1 trap #2 cmpi.w #$ff,d0 bne ok2 move.l #err3,d1 bra err ok2: movea.l fcb2,a0 clr.b 32(a0) read: move #26,d0 * set dma address move.l #buf1,d1 trap #2 move #20,d0 * read sequential move.l fcb1,d1 trap #2 cmpi.w #0,d0 bne end1 write: move #26,d0 * set dma address move.l #buf2,d1 trap #2 move #21,d0 * write sequential move.l fcb2,d1 trap #2 cmpi.w #0,d0 bne werr bra read end1: move #16,d0 * close destination file move.l fcb2,d1 trap #2 cmpi.w #$ff,d0 bne stop move.l #err4,d1 bra err werr: move.l #err5,d1 err: move #9,d0 trap #2 stop: unlk a6 rts data err1: dc.b 13,10,'Cannot open source file!',13,10,'$' err3: dc.b 13,10,'Cannot open destination file!',13,10,'$' err4: dc.b 13,10,'Cannot close destination file!',13,10,'$' err5: dc.b 13,10,'Write error!',13,10,'$' even bss fcb1: ds.l 1 fcb2: ds.l 1 buf1: buf2: ds.b 128 end