* FCOMP.S FILE COMPARE 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 #15,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) read1: 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 read2: move #26,d0 * set dma address move.l #buf2,d1 trap #2 move #20,d0 * read sequential move.l fcb2,d1 trap #2 cmpi.w #0,d0 bne end2 movea.l #buf1,a0 movea.l #buf2,a1 move.w #128-1,d0 loop: cmpm.b (a0)+,(a1)+ bne error dbra d0,loop bra read1 end1: move.l #ok,d1 bra err end2: error: move.l #nook,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,'$' err5: dc.b 13,10,'Write error!',13,10,'$' ok: dc.b 13,10,'SOURCE AND DESTINATION FILES ARE SAME.',13,10,'$' nook: dc.b 13,10,'Source and destnation files are diferent.',13,10,'$' even bss fcb1: ds.l 1 fcb2: ds.l 1 buf1: ds.b 128 buf2: ds.b 128 end