home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / cpm68k / msutils.lbr / COMP.SQ / COMP.S
Encoding:
Text File  |  1988-02-18  |  16.5 KB  |  658 lines

  1. *#######################################################################
  2. *         PROGRAM COMP...File Compare Utility
  3. *
  4. *            Dr. David C. Wilcox
  5. *            DCW Industries, Inc.
  6. *         5354 Palm Dr., La Canada, CA  91011
  7. *               818/790-3844
  8. *
  9. *              April 13, 1986
  10. *#####################################################################
  11. boot    equ    00        *warm boot
  12. rchar    equ    01        *console input
  13. wchar    equ    02        *console output
  14. print    equ    09        *print string
  15. constat    equ    11        *console status
  16. openf    equ    15        *open file
  17. readf    equ    20        *sequential read
  18. setdma    equ    26        *set dma address
  19. userf    equ    32        *get/set user number
  20. break    equ    03        *ascii etx (^C)
  21. lf    equ    10        *line feed
  22. cr    equ    13        *carriage return
  23. xoff    equ    19        *ascii dc3 (^S)
  24. esc    equ    27        *ascii escape
  25. space    equ    32        *ascii space
  26. upmask    equ    $5f        *upper case mask
  27. bdos    equ    $0002        *BDOS entry point
  28. *#####################################################################
  29. *  Special registers:
  30. *
  31. *    a4 = address of 2nd parsed fcb
  32. *    a5 = address of dma buffer
  33. *    a6 = address of 1st parsed fcb
  34. *    d4 = number of records in file2
  35. *    d5 = total number of records
  36. *    d6 = number of records in file1
  37. *    d7 = current user number
  38. *#####################################################################
  39. *
  40. *  Locate fcb and dma (for portability)
  41. *
  42.     link    a6,#0        *mark stack frame
  43.     move.l    8(a6),a0    *get base page address
  44.     lea    $80(a0),a5    *get address of dma buffer
  45.     lea    $5c(a0),a6    *get address of 1st parsed file name
  46.     lea    $38(a0),a4    *get address of 2nd parsed file name
  47.     jsr    clear        *clear all data registers
  48. *
  49. *  Check for no files specified
  50. *
  51.     cmpi.b    #space,$1(a6)
  52.     bne    start
  53.     move.l    #usage,d1    *if no parameters...
  54.     jsr    pstring        *display instructions
  55.     jsr    quit        *and exit to CP/M
  56. *
  57. start:    movea.l    a5,a1        *point to dma
  58.     move.b    (a1)+,d2    *put total characters in d2
  59. *
  60.     move.l    #0,d5        *get the name of file1
  61.     movea.l    #file1,a0
  62. sfile1:    move.b    (a1)+,(a0)+
  63.     addq    #1,d5
  64.     subq    #1,d2        *make sure we're not out of characters
  65.     beq    error        *before we find a space
  66.     cmpi.b    #space,(a1)
  67.     bne    sfile1
  68.     adda.l    #1,a1        *skip over the space
  69. *
  70.     move.l    #0,d4        *now get the name of file2
  71.     movea.l    #file2,a0
  72. dfile1:    move.b    (a1)+,(a0)+
  73.     addq    #1,d4
  74.     subq    #1,d2        *make sure we're not out of characters
  75.     blt    error        *before we find the null
  76.     cmpi.b    #0,(a1)
  77.     bne    dfile1
  78. *
  79. *  Parse the filespecs and make valid fcb's if necessary
  80. *
  81.     jsr    chkwld        *check for wildcards
  82.     jsr    usrset        *set default user numbers
  83.     jsr    usrchk        *check for compare across user areas
  84. *
  85. *  Open the files
  86. *
  87.     jsr    open1        *open file1
  88.     jsr    open2        *open file2
  89.     move.b    #0,32(a6)    *set current record to zero for
  90.     move.b    #0,32(a4)    *both file1 and file2
  91. *
  92. *  Fill the buffers and compare 16k at a time
  93. *
  94.     move.l    #0,d5        *initialize record count
  95. fillem:    jsr    chkcon        *check console
  96.     jsr    filbuf2        *fill buffer2
  97.     jsr    chkcon        *check console
  98.     jsr    filbuf1        *fill buffer1
  99.     jsr    compare        *compare byte by byte
  100.     cmpi.w    #0,d5        *any more extents?
  101.     beq    quit        *no....all done
  102.     bra    fillem        *yes...go back for more
  103. *
  104. *#######################################################################
  105. *                           Subroutines
  106. *#######################################################################
  107. *
  108. *  Change user number if different from current user
  109. *
  110. chgusr:
  111.     cmp.b    d7,d1
  112.     beq    donusr
  113.     move.b    d1,d7
  114.     move.w    #userf,d0
  115.     trap    #bdos
  116. donusr:    rts
  117. *
  118. *  Check for character entered at keyboard
  119. *
  120. chkcon:
  121.     move.w    #constat,d0    *check console status
  122.     trap    #bdos
  123.     cmpi.b    #0,d0        *anything there?
  124.     beq    chkdon        *no....return
  125. getchr:    move.w    #rchar,d0    *yes...get the character
  126.     trap    #bdos
  127.     cmpi.b    #break,d0    *is it an abort (^C)?
  128.     beq    uabort        *yes...say so and return to CP/M
  129.     cmpi.b    #xoff,d0    *is it a pause (^S)?
  130.     bne    chkdon        *no....ignore it and return
  131.     bra    getchr        *yes...hang until another char entered
  132. uabort:    move.l    #ustop,d1    *display user abort message
  133.     jsr    pstring
  134.     bra    quit        *and return to CP/M
  135. chkdon:    rts
  136. *
  137. *  Check for wildcards in parsed fcb's
  138. *
  139. chkwld:
  140.     move.l    #11,d2
  141.     movea.l    a6,a2
  142.     movea.l    a4,a3
  143.     adda    #1,a2
  144.     adda    #1,a3
  145. cloop:    cmpi.b    #'?',(a2)+
  146.     beq    nowild
  147.     cmpi.b    #'?',(a3)+
  148.     beq    nowild
  149.     subq.b    #1,d2
  150.     bne    cloop
  151.     rts
  152. *
  153. *  Clear all data registers
  154. *
  155. clear:
  156.     clr.l    d0
  157.     clr.l    d1
  158.     clr.l    d2
  159.     clr.l    d3
  160.     clr.l    d4
  161.     clr.l    d5
  162.     clr.l    d6
  163.     clr.l    d7
  164.     rts
  165. *
  166. *  Clear fcb
  167. *
  168. clrfcb:
  169.     movea.l    a0,a2
  170.     move.l    #11,d3
  171. blank1:    move.b    #space,(a2)+
  172.     subq    #1,d3
  173.     bne    blank1
  174.     move.l    #20,d3
  175. blank2:    move.b    #0,(a2)+
  176.     subq    #1,d3
  177.     bne    blank2
  178.     rts
  179. *
  180. *  Compare the two files and report any differences found
  181. *
  182. compare:
  183.     move.l    d4,d3
  184.     cmp.l    d4,d6        *same number of sectors?
  185.     beq    samlen        *yes...continue
  186.     bgt    eof2
  187.     move.b    #1,flag1    *mark file1 as shortest
  188.     move.l    d6,d3
  189.     bra    samlen
  190. eof2:    move.b    #1,flag2    *mark file2 as shortest
  191. samlen:    add.l    d3,d5        *update record count
  192.     cmpi.b    #128,d3        *is this the last extent?
  193.     beq    skip        *no....continue
  194.     move.b    #1,lastex    *yes...set flag
  195. skip:    clr.l    d2        *zero the byte count
  196.     movea.l    #buffer1,a1    *point to file1
  197.     movea.l    #buffer2,a2    *point to file2
  198. compr:    cmpm.b    (a1)+,(a2)+    *compare a byte
  199.     beq    same
  200.     jsr    shodif        *show difference message
  201.     addi.b    #1,count    *increment difference count
  202.     movea.l    #count,a0    *check for 10 differences
  203.     cmpi.b    #10,(a0)
  204.     beq    abort        *give up if 10 differences
  205. same:    addq.b    #1,d2        *increment byte count
  206.     cmpi.b    #128,d2        *end of record?
  207.     bne    compr        *no....go back for another character
  208.     subq.b    #1,d3        *decrement record count
  209.     beq    nomore        *quit if all records compared
  210.     jsr    chkcon        *check the console
  211.     clr.l    d2        *reset the byte counter
  212.     bra    compr        *and go back for another record
  213. nomore:    movea.l    #lastex,a0    *is this the last extent?
  214.     cmpi.b    #1,(a0)
  215.     beq    finish        *yes...print final message
  216.     rts    
  217. finish:    movea.l    #count,a0    *check difference count
  218.     cmpi.b    #0,(a0)        *any found?
  219.     bne    unequal        *yes...say so and quit
  220.     move.l    #crlf,d1
  221.     jsr    pstring        *no....display identical message
  222.     move.l    #file1,d1
  223.     jsr    pstring
  224.     move.l    #eqmsg1,d1
  225.     jsr    pstring
  226.     move.l    #file2,d1
  227.     jsr    pstring
  228.     move.l    #eqmsg2,d1
  229.     jsr    pstring
  230. unequal:movea.l    #flag1,a0    *check for early eof on file1
  231.     cmpi.b    #1,(a0)        *flag set?
  232.     bne    check2        *no....check file2
  233.     move.l    #efmsg1,d1    *yes...say so and quit
  234.     jsr    pstring
  235.     move.l    #file1,d1
  236.     jsr    pstring
  237.     move.l    #efmsg2,d1
  238.     jsr    pstring
  239.     move.l    #file2,d1
  240.     jsr    pstring
  241.     move.l    #crlf,d1
  242.     jsr    pstring
  243.     bra    alldone
  244. check2:    movea.l    #flag2,a0    *check for early eof on file2
  245.     cmpi.b    #1,(a0)        *flag set?
  246.     bne    alldone        *no...exit
  247.     move.l    #efmsg1,d1    *yes...say so and quit
  248.     jsr    pstring
  249.     move.l    #file2,d1
  250.     jsr    pstring
  251.     move.l    #efmsg2,d1
  252.     jsr    pstring
  253.     move.l    #file1,d1
  254.     jsr    pstring
  255.     move.l    #crlf,d1
  256.     jsr    pstring
  257.     bra    alldone
  258. abort:    move.l    #abtmsg,d1
  259.     jsr    pstring
  260. alldone:move.l    #0,d5        *d5 = 0 causes exit
  261.     rts
  262. *
  263. *  Show record and byte where difference exists
  264. *
  265. shodif:
  266.     move.l    #dfmsg1,d1    *print first part of message
  267.     jsr    pstring
  268.     move.l    d5,d1        *compute record number
  269.     sub.l    d3,d1
  270.     jsr    decprt        *display it
  271.     move.l    #dfmsg2,d1    *print second part of message
  272.     jsr    pstring
  273.     move.l    d2,d1        *display byte number
  274.     jsr    decprt
  275.     move.l    #crlf,d1    *conclude with cr,lf
  276.     jsr    pstring
  277.     rts
  278. *
  279. *  Print d1 in decimal
  280. *
  281. decprt:
  282.     move.l    d3,d3save    *save register d3
  283.     move.l    d4,d4save    *save register d4
  284.     move.l    d1,d4
  285.     clr.l    d3        *print 1000's digit
  286.     move.w    d4,d3
  287.     divu    #1000,d3
  288.     move.l    d3,d4
  289.     jsr    digit
  290.     swap    d4
  291.     clr.l    d3        *print 100's digit
  292.     move.w    d4,d3
  293.     divu    #100,d3
  294.     move.l    d3,d4
  295.     jsr    digit
  296.     swap    d4
  297.     clr.l    d3        *print 10's digit
  298.     move.w    d4,d3
  299.     divu    #10,d3
  300.     move.l    d3,d4
  301.     jsr    digit
  302.     swap    d4
  303.     move.w    d4,d1        *print units digit
  304.     addi.b    #'0',d1
  305.     jsr    type
  306.     movea.l    #d3save,a0    *restore d3 and d4
  307.     move.l    (a0),d3
  308.     movea.l    #d4save,a0
  309.     move.l    (a0),d4
  310.     rts
  311. digit:    move.b    d3,d1
  312.     addi.b    #'0',d1        *make it ascii
  313. type:    move.w    #wchar,d0    *and print it
  314.     trap    #bdos
  315.     rts
  316. *
  317. *  Fill buffer1
  318. *
  319. filbuf1:
  320.     clr.l    d1        *select appropriate user number
  321.     movea.l    #user1,a0
  322.     move.b    (a0),d1
  323.     jsr    chgusr
  324.     move.l    #0,d6        *initialize record count
  325.     movea.l    #buffer1,a3    *point to start of buffer
  326. loopf1:    move.l    a3,d1        *set dma to current location
  327.     move.w    #setdma,d0    *in buffer1
  328.     trap    #bdos
  329.     move.l    a6,d1        *point to fcb1
  330.     move.w    #readf,d0    *and read a record
  331.     trap    #bdos
  332.     cmpi.b    #1,d0        *end of file?
  333.     beq    donfl1        *yes...stop reading
  334.     addq.b    #1,d6        *no....increment record count
  335.     cmpi.b    #128,d6        *have we done a complete extent?
  336.     beq    donfl1        *yes...stop reading, buffer is full
  337.     adda.l    #128,a3        *no....add 128 to buffer address
  338.     bra    loopf1        *and go back for another record
  339. donfl1:    rts
  340. *
  341. *  Fill buffer2
  342. *
  343. filbuf2:
  344.     clr.l    d1        *select appropriate user number
  345.     movea.l    #user2,a0
  346.     move.b    (a0),d1
  347.     jsr    chgusr
  348.     move.l    #0,d4        *initialize record count
  349.     movea.l    #buffer2,a3    *point to start of buffer
  350. loopf2:    move.l    a3,d1        *set dma to current location
  351.     move.w    #setdma,d0    *in buffer2
  352.     trap    #bdos
  353.     move.l    a4,d1        *point to fcb1
  354.     move.w    #readf,d0    *and read a record
  355.     trap    #bdos
  356.     cmpi.b    #1,d0        *end of file?
  357.     beq    donfl2        *yes...stop reading
  358.     addq.b    #1,d4        *no....increment record count
  359.     cmpi.b    #128,d4        *have we done a complete extent?
  360.     beq    donfl2        *yes...stop reading, buffer is full
  361.     adda.l    #128,a3        *no....add 128 to buffer address
  362.     bra    loopf2        *and go back for another record
  363. donfl2:    rts
  364. *
  365. *  Open file1
  366. *
  367. open1:
  368.     clr.l    d1
  369.     movea.l    #user1,a0
  370.     move.b    (a0),d1
  371.     jsr    chgusr
  372.     move.l    a6,d1
  373.     move.w    #openf,d0
  374.     trap    #bdos
  375.     cmpi.b    #$ff,d0
  376.     bne    donop1
  377.     move.l    #nofile,d1
  378.     jsr    pstring
  379.     move.l    #file1,d1
  380.     jsr    pstring
  381.     move.l    #crlf,d1
  382.     jsr    pstring
  383.     bra    quit
  384. donop1:    rts
  385. *
  386. *  Open file2
  387. *
  388. open2:
  389.     clr.l    d1
  390.     movea.l    #user2,a0
  391.     move.b    (a0),d1
  392.     jsr    chgusr
  393.     move.l    a4,d1
  394.     move.w    #openf,d0
  395.     trap    #bdos
  396.     cmpi.b    #$ff,d0
  397.     bne    donop2
  398.     move.l    #nofile,d1
  399.     jsr    pstring
  400.     move.l    #file2,d1
  401.     jsr    pstring
  402.     move.l    #crlf,d1
  403.     jsr    pstring
  404.     bra    quit
  405. donop2:    rts
  406. *
  407. *  Display the string addressed by d1 on the console
  408. *
  409. pstring:
  410.     move.w    #print,d0
  411.     trap    #bdos
  412.     rts
  413. *
  414. *  Display error message and quit
  415. *
  416. error:    
  417.     move.l    #errmsg,d1
  418.     jsr    pstring
  419. *
  420. *  Quit to CP/M
  421. *
  422. quit:    
  423.     clr.l    d1
  424.     movea.l    #user0,a0
  425.     move.b    (a0),d1
  426.     jsr    chgusr
  427.     move.w    #boot,d0
  428.     trap    #bdos
  429. *
  430. *  Display no wildcard message
  431. *
  432. nowild:
  433.     move.l    #wldmsg,d1
  434.     jsr    pstring
  435.     bra    quit
  436. *
  437. *  Fill the fcb's
  438. *
  439. filfcb:
  440.     movea.l    a3,a0
  441.     adda    #1,a0        *point to first char in file name
  442.     jsr    clrfcb        *fill fcb with spaces
  443.     move.l    #8,d3        *d3 is the counter
  444. lname:    move.b    (a1)+,d0    *get character from dma string
  445.     cmpi.b    #'*',d0        *disallow wildcards
  446.     beq    nowild
  447.     cmpi.b    #'?',d0
  448.     beq    nowild
  449.     cmpi.b    #'.',d0        *filetype delimiter?
  450.     beq    lnamef
  451.     cmpi.b    #'a',d0        *lower case?
  452.     blt    nsave
  453.     andi.b    #upmask,d0    *make it upper case
  454. nsave:    move.b    d0,(a0)+    *store it in fcb
  455.     subq    #1,d3
  456.     beq    lnamef        *all 8 chars processed
  457.     subq    #1,d2
  458.     beq    fildon        *no more chars in dma string
  459.     bra    lname        *go back for another character
  460. lnamef:    subq    #1,d2
  461.     beq    fildon        *no more chars in dma string
  462.     movea.l    a3,a0        *make a0 point to first
  463.     adda    #9,a0        *char in type field
  464.     cmpi.b    #'.',(a1)    *are we pointing to delimiter?
  465.     bne    fnext        *no...carry on
  466.     adda    #1,a1        *yes...skip over it
  467.     subq    #1,d2
  468.     beq    fildon        *no more chars in dma string
  469. fnext:    move.l    #3,d3        *d3 is the counter
  470. ltype:    move.b    (a1)+,d0    *get character from dma string
  471.     cmpi.b    #'*',d0        *disallow wildcards
  472.     beq    nowild
  473.     cmpi.b    #'?',d0
  474.     beq    nowild
  475.     cmpi.b    #'a',d0        *lower case?
  476.     blt    msave
  477.     andi.b    #upmask,d0    *make it upper case
  478. msave:    move.b    d0,(a0)+    *store it in fcb
  479.     subq    #1,d3
  480.     beq    fildon        *all 3 chars processed
  481.     subq    #1,d2
  482.     beq    fildon        *no more chars in dma string
  483.     bra    ltype        *go back for another character
  484. fildon:    rts
  485. *
  486. *  Check for file1 user area
  487. *
  488. usrchk:    
  489.     movea.l    #file1,a1
  490.     move.b    d5,d2
  491.     move.w    #1,d1
  492. schek:    cmpi.b    #':',(a1)
  493.     beq    sdrv
  494.     adda    #1,a1
  495.     addq    #1,d1
  496.     subq    #1,d2
  497.     bne    schek
  498.     bra    dchek0        *no user specified...check file2
  499. sdrv:    cmpi.b    #2,d1        *is it the logged user?
  500.     bne    sdig1        *no...check number of digits
  501.     bra    dchek0        *yes...further action not required
  502. sdig1:    cmpi.b    #3,d1        *is it a single digit user?
  503.     bne    sdig2        *no...check for two digit user
  504.     movea.l    #file1,a1    *get the drive number
  505.     move.b    (a1)+,d0
  506.     andi.b    #upmask,d0    *make it upper case
  507.     subi.b    #64,d0        *make it a number
  508.     move.b    d0,(a6)        *save it in fcb1
  509.     move.b    (a1),d0        *get user number
  510.     subi.b    #'0',d0        *make it a number
  511.     move.b    d0,user1    *save user number in proper location
  512.     move.b    d5,d2
  513.     subq    #3,d2
  514.     movea.l    #file1+3,a1    *copy the rest to fcb1
  515.     movea.l    a6,a3
  516.     jsr    filfcb
  517.     bra    dchek0
  518. sdig2:    cmpi.b    #4,d1        *is it a two digit user?
  519.     bne    error        *no...incorrect user number
  520.     movea.l    #file1,a1    *get the drive number
  521.     move.b    (a1)+,d0
  522.     andi.b    #upmask,d0    *make it upper case
  523.     subi.b    #64,d0        *make it a number
  524.     move.b    d0,(a6)        *save it in fcb1
  525.     movea.l    #file1+2,a1    *get the second digit of user number
  526.     move.b    (a1),d0        *put it in d0
  527.     subi.b    #'0',d0        *make it a number
  528.     addi.b    #10,d0        *add 10 to it
  529.     move.b    d0,user1    *save user number in proper location
  530.     move.b    d5,d2
  531.     subq    #4,d2
  532.     movea.l    #file1+4,a1    *copy the rest to fcb1
  533.     movea.l    a6,a3
  534.     jsr    filfcb
  535. dchek0:    movea.l    #file2,a1    *check for file2 user area
  536.     move.b    d4,d2
  537.     move.w    #1,d1
  538. dchek:    cmpi.b    #':',(a1)
  539.     beq    ddrv
  540.     adda    #1,a1
  541.     addq    #1,d1
  542.     subq    #1,d2
  543.     bne    dchek
  544.     move.b    d4,d2        *no drive or user specified
  545.     movea.l    #file2,a1    *fill fcb2 in case a user was
  546.     movea.l    a4,a3        *given for file1 which sometimes
  547.     jsr    filfcb        *zaps the second fcb
  548.     rts
  549. ddrv:    cmpi.b    #2,d1        *is it the logged user?
  550.     bne    ddig1        *no...check number of digits
  551.     movea.l    #file2,a1    *get the drive number
  552.     move.b    (a1)+,d0
  553.     andi.b    #upmask,d0    *make it upper case
  554.     subi.b    #64,d0        *make it a number
  555.     move.b    d0,(a4)        *save it in fcb2
  556.     move.b    d4,d2        *no user specified
  557.     subq    #2,d2
  558.     movea.l    #file2+2,a1    *fill fcb2 in case a user was
  559.     movea.l    a4,a3        *given for file1 which sometimes
  560.     jsr    filfcb        *zaps the second fcb
  561.     rts
  562. ddig1:    cmpi.b    #3,d1        *is it a single digit user?
  563.     bne    ddig2        *no...check for two digit user
  564.     movea.l    #file2,a1    *get the drive number
  565.     move.b    (a1)+,d0
  566.     andi.b    #upmask,d0    *make it upper case
  567.     subi.b    #64,d0        *make it a number
  568.     move.b    d0,(a4)        *save it in fcb2
  569.     move.b    (a1),d0        *get user number
  570.     subi.b    #'0',d0        *make it a number
  571.     move.b    d0,user2    *save user number in proper location
  572.     move.b    d4,d2
  573.     subq    #3,d2
  574.     movea.l    #file2+3,a1    *copy the rest to fcb2
  575.     movea.l    a4,a3
  576.     jsr    filfcb
  577.     rts
  578. ddig2:    cmpi.b    #4,d1        *is it a two digit user?
  579.     bne    error        *no...incorrect user number
  580.     movea.l    #file2,a1    *get the drive number
  581.     move.b    (a1)+,d0
  582.     andi.b    #upmask,d0    *make it upper case
  583.     subi.b    #64,d0        *make it a number
  584.     move.b    d0,(a4)        *save it in fcb2
  585.     movea.l    #file2+2,a1    *get the 2nd digit of user number
  586.     move.b    (a1),d0        *put it in d0
  587.     subi.b    #'0',d0        *make it a number
  588.     addi.b    #10,d0        *add 10 to it
  589.     move.b    d0,user2    *and store it in proper location
  590.     move.b    d4,d2
  591.     subq    #4,d2
  592.     movea.l    #file2+4,a1    *copy the rest to fcb2
  593.     movea.l    a4,a3
  594.     jsr    filfcb
  595.     rts
  596. *
  597. *  Set default user numbers
  598. *
  599. usrset:
  600.     move.w    #$ff,d1
  601.     move.w    #userf,d0
  602.     trap    #bdos
  603.     move.b    d0,d7
  604.     move.b    d0,user0
  605.     move.b    d0,user1
  606.     move.b    d0,user2
  607.     rts
  608. *#####################################################################
  609. *                          Console Messages
  610. *#####################################################################
  611.     even
  612. d3save:    ds.l    1
  613. d4save:    ds.l    1
  614. count:    dc.b    0            *mismatch count
  615. flag1:    dc.b    0            *file1 eof flag
  616. flag2:    dc.b    0            *file2 eof flag
  617. lastex:    dc.b    0            *last extent flag
  618. user0:    ds.b    1            *user number at start of run
  619. user1:    ds.b    1            *user number for file1
  620. file1:    dc.b    '$$$$$$$$$$$$$$$$'
  621.     dc.b    '$$$$$$$$$$$$$$$$'    *name of file1
  622. user2:    ds.b    1            *user number for file2
  623. file2:    dc.b    '$$$$$$$$$$$$$$$$'
  624.     dc.b    '$$$$$$$$$$$$$$$$'    *name of file2
  625.     even
  626. usage:    dc.b    lf,cr
  627.     dc.b    'Correct usage:',cr,lf,lf
  628.     dc.b    '    COMP  {d1<u1>:}file1  {d2<u2>:}file2'
  629.     dc.b    cr,lf,lf
  630.     dc.b    '        d1 = file1 drive',cr,lf
  631.     dc.b    '           u1 = file1 user number',cr,lf
  632.     dc.b    '           d2 = file2 drive',cr,lf
  633.     dc.b    '           u2 = file2 user number',cr,lf,lf
  634.     dc.b    'COMPare terminates if 10 differences are found'
  635.     dc.b    cr,lf,lf,'$'
  636.     even
  637. errmsg:    dc.b    'File name error...COMP aborted',cr,lf,'$'
  638. wldmsg:    dc.b    'Error...Wildcards NOT supported',cr,lf,'$'
  639. nofile:    dc.b    'Error...Unable to open $'
  640. eqmsg1:    dc.b    ' and $'
  641. eqmsg2:    dc.b    ' are identical',cr,lf,'$'
  642. efmsg1:    dc.b    cr,lf,'End of file on $'
  643. efmsg2:    dc.b    ' before $'
  644. dfmsg1:    dc.b    'Files differ in sector $'
  645. dfmsg2:    dc.b    ', byte $'
  646. crlf:    dc.b    cr,lf,'$'
  647. abtmsg:    dc.b    cr,lf
  648.     dc.b    '  10 differences found..COMP aborted  '
  649.     dc.b    cr,lf,'$'
  650. ustop:    dc.b    cr,lf
  651.     dc.b    '         COMP aborted by user         '
  652.     dc.b    cr,lf,'$'
  653.     even
  654. buffer1    equ    *
  655. buffer2    equ    *+16384
  656. *#####################################################################
  657.     end
  658.