; 13/MAR/85 19:12s?; Revised 25-AUG-1985 17:28:16 (variable directory names added)% .mcall qiow$, qiow$s, exit$s, fcsmc$l .mcall dir$; *** File information ***" fcsmc$ ; .MCALL most FCS macros fsrsz$ 2 ; 2 files+ buflen=2000 ; Size of I/O buffers (octal)1 fillen=23 ; Maximum length of filenames (octal)t3 dirlen=13 ; Maximum length of directories (octal)o(fdb1: fdbdf$ ; File descriptor block 1 fdrc$a ,inbuf,buflena fdop$a 1,dspt1mdspt1: .word dvlen1,dvnam1dlen1: .word 0,drnam1 len1: .word 0,flnam1dvnam1: dvlen1=0 ; Device 1#drnam1: .blkb dirlen ; Directory 1,"flnam1: .blkb fillen ; Filename 1 .even(fdb2: fdbdf$ ; File descriptor block 2 fdrc$a ,outbuf,buflen fdop$a 2,dspt2sdspt2: .word dvlen2,dvnam2dlen2: .word 0,drnam2flen2: .word 0,flnam2dvnam2: dvlen2=0 ; Device 2#drnam2: .blkb dirlen ; Directory 2r"flnam2: .blkb fillen ; Filename 2 .eveninbuf: .blkb buflenioutbuf: .blkb buflen; *** Prompts ***dJfirst: .ascii /CMPBIN: Compares two binary files 2000(8) bytes at a time./ .byte 15,12,12 ; ( CR LF LF )# .ascii /First file specification./l firlen=.-first+second: .ascii /Second file specification./o seclen=.-second<dirpmt: .ascii /Enter screen image directory in uppercase: / drplen=.-dirpmt9prmt: .ascii /Enter screen image filename in uppercase: /2 pmtlen=.-prmt,succ: .ascii /Files have the same contents./ suclen=.-succ/difmsg: .ascii /Files have different contents./* diflen=.-difmsg .even"; *** Repeatedly used QIO DPBs ***read: qiow$ io.rpr,5,2,,iostat4dpb1: qiow$ io.wvb,5,2,,iostat,,>4dpb2: qiow$ io.wvb,5,2,,iostat,,>@; *** I/O Status block (will hold length of typed responses) *** aiostat: .blkw 2p; *** Start of code ***t+start: dir$ #dpb1 ; Print initial messageu* mov #read,r0 ; Read first directory name mov #drnam1,q.iopl(r0)s mov #dirlen,q.iopl+2(r0)  mov #dirpmt,q.iopl+6(r0)t mov #drplen,q.iopl+10(r0) mov #'$,q.iopl+12(r0) dir$ r0 ; Execute read2 mov iostat+2,dlen1 ; Length of directory name #1- mov #flnam1,q.iopl(r0) ; Read first filenamew mov #fillen,q.iopl+2(r0)l mov #prmt,q.iopl+6(r0)t mov #pmtlen,q.iopl+10(r0) mov #'$,q.iopl+12(r0) dir$ r0 ; Execute read*& mov iostat+2,len1 ; Length of file 14 dir$ #dpb2 ; Prompt for second file specification4 mov #drnam2,q.iopl(r0) ; Read second directory name mov #dirlen,q.iopl+2(r0)p mov #dirpmt,q.iopl+6(r0)l mov #drplen,q.iopl+10(r0) mov #'$,q.iopl+12(r0) dir$ r0 mov iostat+2,dlen2,. mov #flnam2,q.iopl(r0) ; Read second filename mov #fillen,q.iopl+2(r0)f mov #prmt,q.iopl+6(r0)i mov #pmtlen,q.iopl+10(r0) mov #'$,q.iopl+12(r0) dir$ r0) mov iostat+2,len2 ; Length of filename2e8 open$r #fdb1 ; Open file (and destroy contents of R0) bcs exitr open$r #fdb2i bcs exita; Do the comparisoni:get: get$ #fdb1 ; Get a record, assume only error is EOF bcs samei get$ #fdb20 bcs samer clr r0 ; Initialize countB1$: cmpb inbuf(r0),outbuf(r0) ; See if equal (could be CMP.W also) bne diffc inc r0a cmp r0,#buflenq blo 1$0 br get#Dsame: qiow$s #io.wvb,#5,#2,,,,<#succ,#suclen,#40> ; (Files the same) br closemGdiff: qiow$s #io.wvb,#5,#2,,,,<#difmsg,#diflen,#40> ; (Files different)d#close: close$ #fdb1 ; Close files close$ #fdb2exit: exit$s ; Exit .end starte