home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / ZCPR33 / A-R / DIFF30.LBR / DIFF30.ZZ0 / DIFF30.Z80
Text File  |  2000-06-30  |  27KB  |  1,307 lines

  1. ;
  2. ; Program:    DIFF
  3. ; Author:    Carson Wilson
  4. ; Version:    3.0
  5. ; Date:        16 February 89
  6.  
  7. vers    equ    30
  8.  
  9. ; Changes:    Linked to corrected ZSGSTPCP routine.
  10. ;        Added "(no stamp)" informative message.
  11. ;        Cleaned up and organized code.
  12.  
  13. ; Author:    Carson Wilson
  14. ; Version:    2.9
  15. ; Date:        29 December 88
  16. ; Changes:    Corrected premature termination error message - said
  17. ;         "Source 1 .." when source 2 terminated prematurely,
  18. ;         and "Source 2 .." for source 1. 
  19. ;        Fixed bugs which caused DIFF to abort during multiple
  20. ;         compares when the files were different or with datestamp
  21. ;         only (/D) option.
  22. ;        Fixed bug introduced by Quiet code which caused files with
  23. ;         same name, different stamp to be treated as equal files.
  24. ;        Swapped OPEN12 and OPEN21 for greater efficiency.
  25. ;        Slash before options now optional if three parameters are
  26. ;         specified.
  27. ;        Added terminating CR to restore cursor on exit.
  28. ;        Linked with new version of ZSLIB which supports Z3PLUS
  29. ;         datestamps.
  30. ; Note:        Could use reorganization for clarity around CABORT:
  31.  
  32. ; Author:    Carson Wilson
  33. ; Version:    2.7
  34. ; Date:        4 September 88
  35. ;
  36. ; Changes:    Changed /D option to /I (ignore datestamps) option.
  37. ;        Added /D option (use datestamps only).
  38. ;        Added /Q (quiet) option.
  39. ;        Patchable options label now "[DIMQV>".
  40. ;        Use ZSLIB PRDAT2 instead of PRDAT3.
  41. ;        Help now does not show ZSDOS options unless ZSDOS present.
  42. ;        Changed "File n is more recent" to "Source n...."
  43. ;        Linked with SYSLIB 3.6 SCOMP routine due to SYSLIB4 bug.
  44. ;        No longer gives "advance" prompt unless multiple compare.
  45.  
  46. ; Author:    Carson Wilson
  47. ; Version:    2.6
  48. ; Date:        24 August 88
  49. ; Changes:    TPA overflow test for high-memory versions.
  50. ;
  51. ;        Register 0 set according to file date comparison:
  52. ;            REG 0 0 if one or both stamps missing or /I,
  53. ;            REG 0 1 if file 1 more recent,
  54. ;            REG 0 2 if file 2 more recent,
  55. ;            REG 0 3 if file dates match.
  56. ;
  57. ;        ZCPR program error flag set by default & reset only if both
  58. ;        files found and names and dates, or data match (at EQUAL).
  59. ;
  60. ;        Added local stack and QUIT routine.
  61. ;
  62. ;        Use SETDMA for fast buffer loading.
  63. ;
  64. ;        Allow abort during VERIFY with ^c.
  65. ;
  66. ;        Use IX for file offset.  NOTE: assumes OS preserves IX.
  67. ;
  68. ;        Patchable options shown in help.
  69. ;
  70. ;        FCBs now parsed by Z33 CCP, so can use options with only 
  71. ;        one file name, e.g., "DIFF myfile /d", and directory/user
  72. ;        parse is same as CCP.  This also saves considerable code.
  73. ;
  74. ;        Implemented DSEG for shorter program length.
  75. ;
  76. ;        Added patchable option defaults.
  77. ;
  78. ;        Changed C(ompare) option to V(erbose) option, making brief
  79. ;        output the default.
  80. ;
  81. ;        Use (z3eadr) to detect ZCPR 3.3 environment,
  82. ;        so that we can run with BGii.  NOTE: if installed with Z3INS,
  83. ;        will now run under ANY environment, with unpredictable results.
  84. ;
  85. ;        Added "loaded at nnnn hex" message.
  86. ;
  87. ;        Chains to Z33 error handler on wildcard names or bad directory.
  88. ;
  89. ;        Removed reference to CAPS routine, shortening code length.
  90. ;
  91. ;             Translated to lower case and Z80 opcodes.
  92. ;
  93. ;        Added datestamp comparison for ZSDOS or DosDisk systems.  Idea
  94. ;        based on DATSWEEP by Bridger Mitchell.  See DIFF26.DOC for
  95. ;        details.
  96. ;
  97. ; Assembly:    Z80ASM, SLRNK, Z3LIB, ZSLIB, SYSLIB.
  98. ;
  99. ;  AUTHOR:  Richard Conn
  100. ;  VERSION:  2.0
  101. ;  DATE:  18 MAY 84
  102. ;  PREVIOUS VERSIONS:  1.6 (16 JAN 83)
  103. ;  PREVIOUS VERSIONS:  1.5 (9 JAN 83), 1.4 (6 JAN 83), 1.3 (4 JAN 83)
  104. ;  PREVIOUS VERSIONS:  1.2 (19 DEC 82), 1.1 (8 DEC 82), 1.0 (24 JULY 82)
  105. ;  DERIVATION:  COMPARE, VERSION 1.1
  106.  
  107. ;  SIZE OF BUFFER
  108.  
  109. blimit    equ    32        ; NUMBER OF 128-BYTE BLOCKS
  110. bsize    equ    blimit*128    ; 4K
  111.  
  112. false    equ    0
  113. true    equ    not false
  114. no    equ    false
  115. yes    equ    true
  116.  
  117. ;  CP/M Constants
  118.  
  119. cpm    equ    0        ; CP/M Warm Boot
  120. fcb1    equ    05ch
  121. fcb2    equ    06ch
  122. defdma    equ    80h
  123. buff    equ    cpm+80h        ; Temporary Buffer
  124. cr    equ    0dh
  125. lf    equ    0ah
  126. tab    equ    9
  127. bell    equ    7
  128. ctrlc    equ    'C'-'@'
  129. ctrlx    equ    'X'-'@'
  130.  
  131. ; BDOS functions
  132.  
  133. prints    equ    9        ; Print string
  134. setdmaf    equ    26
  135.  
  136. ;  ZCPR constants
  137. ;
  138. ;  Z33 error codes
  139. ;
  140. ecambig        equ     8    ; Ambiguous file specification 
  141. ecbaddir    equ    2    ; Bad directory specification
  142. ecnofile    equ    10    ; File not found    
  143.  
  144.     public    $memry                ; SLRNK fills in
  145.  
  146. ;  Externals
  147.  
  148.     ext    getstp,prdat2,ptimm1        ; ZSLIB
  149.     ext    dostyp,cpmver,gstpcp
  150.  
  151.     ext    retcst,puter3             ; Z33LIB (or new Z3LIB)
  152.  
  153.     ext    z3init,getcrt,puter2,putreg    ; Z3LIB
  154.  
  155.     ext    phl4hc,phldc,pa2hc,padc        ; SYSLIB
  156.     ext    bdos,initfcb,sksp,sknsp
  157.     ext    logud,retud
  158.     ext    f$open,f$close,f$read
  159.     ext    cin,cout,crlf,moveb,print,pstr
  160.     ext    compb,condin,setdma 
  161.  
  162. ; ======================================================
  163. ;
  164. ;    CODE BEGINS
  165. ;
  166. entry:
  167.     jp    start
  168.     db    'Z3ENV'
  169.     db    3        ; Type-3 environment
  170. z3eadr:
  171.     dw    0        ; Filled in by CCP
  172. loadadr:
  173.     dw    entry
  174. ;
  175. ; Patchable option defaults
  176. ;
  177.     db    '[DIMQV>'    ; Label for patcher
  178. donlyd:    db    no        ; D atestamp only
  179. ignord:    db    no        ; I gnore datestamps
  180. multd:    db    no        ; M ultiple runs
  181. quietd:    db    no        ; Q uiet
  182. verbd:    db    no         ; V erbose
  183. ;
  184. start:
  185.     ld    hl,(z3eadr)    ; Point to ZCPR3 environment
  186. ;
  187. ; Start of Program -- Initialize ZCPR3 Environment
  188. ;
  189.     ld    a,h
  190.     or    l
  191.     jr    nz,gotz33    ; Filled in at run time if Z33
  192.     call    print
  193.     db    bell,'Need ZCPR 3.3 or greater',0
  194.     ret
  195. gotz33:
  196.     ld    (stksav),sp
  197.     ld    sp,ourstk
  198.  
  199.     call    z3init        ;initialize the ZCPR3 Env and the VLIB Env
  200. ;
  201. ;  Set operations flags from patchable defaults
  202. ;
  203.     ld    bc,5        ; 5 options
  204.     ld    de,donly    ; Target in data segment
  205.     ld    hl,donlyd    ; Source at top of file
  206.     ldir            ; Copy defaults for GO
  207.  
  208.     call    getcrt        ; GET CRT CHARACTERISTICS
  209.     inc    hl        ; PT TO TEXT LINE COUNT
  210.     inc    hl
  211.     ld    a,(hl)        ; GET line COUNT
  212.     ld    (lset),a    ; SET COUNTER
  213. ;
  214. ; Extract command line information
  215. ;
  216.     ld    a,(fcb1+1)
  217.     cp    ' '        ; No parameters? 
  218.     jp    z,prhelp    ; PRINT HELP IF SO
  219.     cp    '/'        ; ASKING FOR HELP?
  220.     jp    z,prhelp
  221. ;
  222. ; Abort to error handler on illegal directories
  223. ;
  224.     ld    a,(06bh)    ; Get Z33 bad dir. flag (0=ok)
  225.     ld    b,a
  226.     ld    a,(07bh)    ; Flag for FCB2
  227.     or    b
  228.     jr    z,zdirsok
  229.     ld    a,ecbaddir    ; Error code
  230.     jp    z33err        ; Chain to EH
  231. ;
  232. ; Warm boot if TPA overflow
  233. ;
  234. zdirsok:
  235.     ld    hl,(6)        ; Get BDOS/RSX addr.
  236. $memry    equ    $+1        ; Initialized by linker
  237.     ld    bc,0        ; Get last byte used by DIFF
  238.     or    a        ; Clear carry
  239.     sbc    hl,bc        ; Last address < max. TPA?
  240.     jr    nc,tpaok    ; Yes
  241.     call    print
  242.     db    bell,'TPA overflow',0
  243.     jp    0        ; Warm boot 
  244. ;
  245. ; Parse command line
  246. ;
  247. tpaok:
  248.     call    retud        ; B = current disk 0..15 
  249.     ld    ix,fcb1
  250.     ld    iy,fcb2
  251. ;
  252. ; Store drives, users for display
  253. ;
  254.     ld    a,(ix)        ; Source drive
  255.     or    a
  256.     jr    nz,stores
  257.     ld    a,b        ; Disk from RETUD above
  258.     inc    a        ; To 1..16
  259. stores:
  260.     ld    (sdisk),a
  261.     ld    a,(iy)
  262.     or    a
  263.     jr    nz,stored
  264.     ld    a,b
  265.     inc    a        ; To 1..16
  266. stored:
  267.     ld    (ddisk),a
  268.  
  269.     ld    a,(ix+13)    ; Store users
  270.     ld    (suser),a
  271.     ld    a,(iy+13)
  272.     ld    (duser),a    
  273. ;
  274. ; Move FCB2 to high memory
  275. ;
  276.     ld    hl,fcb2
  277.     ld    de,fcbd
  278.     ld    b,12        ; Drive, name
  279.     call    moveb
  280. ;
  281.     ld    a,(iy+1)
  282.     cp    '/'        ; 2nd name given?
  283.     jr    z,onename    ; No
  284.     cp    ' '
  285.     jr    nz,twoname    ; Yes
  286. ;
  287. ; No 2nd name, so copy 1st to 2nd
  288. ;
  289. onename:            ; Set 2nd name to same as first
  290.     ld    hl,fcb1+1
  291.     ld    de,fcbd+1
  292.     ld    b,11        ; 11 BYTES
  293.     call    moveb
  294. twoname:
  295.     ld    hl,fcb1        ; SET UP SOURCE FCB
  296.     call    qcheck        ; NO AMBIGUOUS ENTRIES PERMITTED
  297.     ld    hl,fcbd        ; SET UP DESTINATION FCB
  298.     call    qcheck        ; NO AMBIGUOUS ENTRIES PERMITTED
  299. ;
  300.     ld    hl,buff+1
  301.     call    sksp        ; Skip parm1...
  302.     call    sknsp
  303.     call    sksp
  304.     ld    a,'/'    
  305.     cp    (hl)        ; "/"parm2?
  306.     jr    z,gotopt    ; Yes, parse options
  307.     call    sknsp
  308.     call    sksp
  309. gotopt:    inc    (hl)
  310.     dec    (hl)        ; Terminator?
  311.     call    nz,opts        ; No, parse option(s)
  312.  
  313. ; ----------------------------------------------------
  314. ;
  315. ; Compare files (re-enter here for multiple compares) 
  316.  
  317. mloop:
  318.  
  319. ; Set program error flag and register 0 to defaults
  320.  
  321.     ld    a,0ffh
  322.     call    puter2        ; Set program error flag TRUE
  323.     xor    a
  324.     ld    b,a
  325.     call    putreg        ; Set register 0 to 0
  326.  
  327. ; Print banner
  328.  
  329.     call    banner
  330.     ld    a,(mult)    ; Multiple runs?
  331.     or    a
  332.     jr    z,mloop1    ; No, print names (and dates if used)
  333.     call    qtest
  334.     jr    nz,mloop1    ; Override /M if quiet
  335.  
  336.     call    print
  337.     db    cr,lf,' Strike ^C to Abort or RETURN to Proceed: ',0
  338.     call    cin        ; GET RESPONSE
  339.     cp    ctrlc        ; ABORT?
  340.     jp    z,dabort1
  341.     ld    c,13        ; RESET DISKS
  342.     call    bdos
  343. mloop1:
  344. ;
  345. ; Use datestamps?
  346. ;    
  347.     call    prs1        ; Print source file name one
  348.     ld    a,(ignor)    ; Test flag
  349.     or    a
  350.     jr    z,dodate    ; If stamps, don't show second name now
  351. mloop1a:
  352.     call    prs2        ; Print name two
  353.     jp    open12        ; And go compare if needed
  354. ;
  355. ; Test if names equal
  356. ;
  357. dodate:
  358.     ld    de,fcb1+1
  359.     ld    hl,fcbd+1
  360.     ld    b,11
  361.     call    compb        ; SYSLIB
  362.     ld    a,0
  363.     jr    z,storen    ; Names match
  364.     ld    a,0ffh
  365. storen:
  366.     ld    (names),a    ; 0=names match
  367. ;
  368. ; Display stamps
  369. ;
  370.     call    space1
  371.     call    logs        ; Log to source disk/user
  372.  
  373.     ld    de,fcb1
  374.     ld    hl,sdatbuf
  375.     call    getstp
  376.     jr    z,dodat0    ; Got stamp
  377.     call    gstpcp        ; Try for CP/M Plus stamp
  378.     jr    z,dodat0    ; Got stamp
  379.     call    noserr        ; Say no stamp
  380.     jr    mloop1a        ; Skip stamps
  381. dodat0:
  382.     ld    hl,smodbuf
  383.     call    qprdat2        ; Try to print modify    
  384.     ld    (smodok),a    ; Save as flag (0=ok)
  385.     jr    z,dodat1    ; Modify ok
  386.  
  387.     ld    hl,sdatbuf    ; Try to print create
  388.     call    qprdat2
  389.     jr    z,dodat1    ; Got stamp
  390.     call    noserr        ; Say no stamp
  391.     jr    mloop1a        ; Skip stamps
  392. dodat1:
  393.     call    space1
  394.     call    qtest
  395.     call    z,ptimm1    ; Show time
  396.  
  397.     ld    a,(smodok)    ; Got source modify?
  398.     or    a
  399.     ld    hl,cstring
  400.     jr    nz,dodat2    ; No, say create
  401.     ld    hl,mstring
  402. dodat2:
  403.     call    qtest        ; If not quiet
  404.     call    z,pstr        ; ..say create or modify
  405. ;
  406. ; Got source stamp, now look for dest.
  407. ;
  408.     call    prs2        ; Print name 2
  409.     call    space1
  410.     call    logd        ; Log to dest. disk/user
  411.  
  412.     ld    de,fcbd        ; Search for dest. stamp
  413.     ld    hl,ddatbuf
  414.     call    getstp
  415.     jr    z,dodat3    ; Got stamp
  416.     call    gstpcp        ; Try for CP/M Plus stamp
  417.     jr    z,dodat3    ; Got stamp
  418.     call    noserr
  419.     jp    open21        ; No dest stamp, skip compare
  420. dodat3:    ld    hl,dmodbuf
  421.     call    qprdat2
  422.     ld    (dmodok),a    ; Save (0=ok)
  423.     jr    z,dodat4
  424.  
  425.     ld    hl,ddatbuf
  426.     call    qprdat2
  427.     jr    z,dodat4    ; Got stamp
  428.     call    noserr        ; Say no stamp
  429.     jr    open21        ; Skip stamps
  430. dodat4:
  431.     call    space1
  432.     call    qtest
  433.     call    z,ptimm1    ; Show time
  434.  
  435.     ld    hl,mstring    ; Say modify
  436.     ld    a,(dmodok)    ; Using modify?
  437.     or    a
  438.     jr    z,dodat5    ; Yes
  439.     ld    hl,cstring    ; No, say create
  440. dodat5:
  441.     call    qtest
  442.     call    z,pstr        ; Say create or modify
  443.  
  444.     ld    hl,smodbuf    ; Point to modify
  445.     ld    a,(smodok)    ; Got source modify stamp?
  446.     or    a
  447.     jr    z,dodat6    ; Yes
  448.     ld    hl,sdatbuf    ; No, use create
  449. dodat6:
  450.     ld    de,dmodbuf    ; Point to dest. modify
  451.     ld    a,(dmodok)    ; ok?
  452.     or    a
  453.     jr    z,dodat7    ; Yes
  454.     ld    de,ddatbuf    ; No, use dest. create
  455. dodat7:
  456.     ld    b,5        ; Test 5 bytes yy mm dd hh mm
  457.     call    compb        ; SYSLIB
  458.     ld    b,0        ; Set register 0
  459.     ld    a,3        ; Dates match
  460.     ld    hl,dmatstr
  461.     jr    z,dodat8
  462.     ld    a,2        ; File 2 more recent
  463.     ld    hl,twostr
  464.     jr    c,dodat8
  465.     ld    a,1        ; File 1 more recent 
  466.     ld    hl,onestr
  467. dodat8:
  468.     call    putreg
  469.     push    af        ; Save flags
  470.     call    qtest
  471.     jr    nz,dodat9    ; No display if quiet
  472.     call    crlf
  473.     call    pstr        ; Show dates status
  474. dodat9:
  475.     pop    af        ; Get flags
  476.     jp    nz,open21    ; Stamps don't match, compare data
  477.  
  478.     ld    a,(names)
  479.     or    a        ; Names match?
  480.     jp    z,equal1    ; Yes, exit or loop back for next test
  481.  
  482. ; --------------------------------------------
  483. ;
  484. ; Open files for data compare
  485. ;
  486. ; Open source 2, then source 1
  487. ;
  488. open21:
  489.     ld    a,(donly)
  490.     or    a
  491.     jp    nz,mloop2    ; Quit if datestamp only test
  492.  
  493.     call    logd        ; Log in dest
  494.     ld    de,fcbd        ; TRY TO OPEN SOURCE 2
  495.     call    initfcb        ; INIT FCB
  496.     call    f$open
  497.     jp    nz,f2err
  498.  
  499.     call    logs        ; LOG IN SOURCE
  500.     ld    de,fcb1        ; TRY TO OPEN SOURCE 1
  501.     call    initfcb        ; Init FCB in case /i option used
  502.     call    f$open        ; Z IF NO ERROR
  503.     jp    nz,f1err
  504.     jr    compare
  505. ;
  506. ; Open source 1, then source 2
  507. ;
  508. open12:
  509.     ld    a,(donly)
  510.     or    a
  511.     jp    nz,mloop2    ; Quit if datestamp only test
  512.  
  513.     call    logs        ; LOG IN SOURCE
  514.     ld    de,fcb1        ; TRY TO OPEN SOURCE 1
  515.     call    initfcb        ; Init FCB in case /i option used
  516.     call    f$open        ; Z IF NO ERROR
  517.     jp    nz,f1err
  518. ;
  519.     call    logd        ; LOG IN DEST DISK/USER
  520.     ld    de,fcbd        ; TRY TO OPEN SOURCE 2
  521.     call    initfcb        ; INIT FCB
  522.     call    f$open
  523.     jp    nz,f2err
  524. ;
  525. ; Both files open.  Compare data.
  526. ;
  527. compare:
  528.     xor    a        ; A=0
  529.     ld    (first),a    ; SET FLAG FOR FIRST ERROR
  530.     ld    ix,0        ; Init offset
  531.     call    verify        ; PERFORM VERIFICATION
  532.     ld    a,(first)    ; ANY ERRORS?
  533.     or    a        ; Match? 
  534.     jp    nz,mloop2    ; No
  535. ;
  536. ; Files identical.  Tell user.
  537. ;
  538. equal:
  539.     call    qtest
  540.     jr    nz,equal1    ; No display if quiet
  541.     call    print
  542.     db    cr,lf,' Files are identical',0
  543. ;
  544. ; Files identical or names and dates match.  Reset program error flag
  545. ;
  546. equal1:
  547.     xor    a        ; No errors, so files match
  548.     call    puter2        ; Reset ZCPR program error flag
  549. mloop2:
  550.     ld    a,(mult)    ; CHECK FOR MULTIPLE RUNS
  551.     cpl
  552.     ld    b,a        ; 0ffh=single
  553.     ld    a,(quiet)    ; 0ffh=quiet
  554.     or    b        ; Single or quiet?
  555.     jp    nz,quitlf    ; Yes, exit
  556. ;
  557. ; Back for next test (multiple run)
  558. ;
  559.     call    crlf        ; NEW LINES
  560.     jp    mloop
  561.  
  562. ; -----------------------------------------
  563. ;
  564. ; File open errors
  565. ;
  566. f1err:
  567.     call    prs1a
  568.     jr    ferr
  569. f2err:
  570.     call    prs2a
  571. ferr:
  572.     call    print
  573.     db    '- not found',0
  574.     jp    mloop2
  575.  
  576. ; No stamp error
  577.  
  578. noserr:
  579.     call    qtest
  580.     ret    nz        ; Don't print if quiet
  581.     call    print
  582.     db    '(no stamp) ',0
  583.     ret
  584.  
  585. ; ----------------------------------------------
  586. ;
  587. ;  Parse command line options
  588. ;
  589. opts:
  590.     ld    a,(hl)        ; GET NEXT OPTION CHAR
  591.     inc    hl        ; PT TO NEXT
  592.     or    a        ; END OF LINE?
  593.     ret    z
  594.     cp    ' '        ; SKIP SPACES
  595.     jr    z,opts
  596.     cp    ','        ; ..commas..
  597.     jr    z,opts
  598.     cp    '/'        ; ..and slashes     
  599.     jr    z,opts
  600.     ld    de,otab        ; PT TO OPTION TABLE
  601.     ld    b,a        ; OPTION CHAR IN B
  602. opts1:
  603.     ld    a,(de)        ; GET TABLE CHAR
  604.     or    a        ; OPTION NOT FOUND?
  605.     jp    z,prhelp
  606.     cp    b        ; MATCH?
  607.     jr    z,opts2
  608.     inc    de        ; SKIP TO NEXT
  609.     inc    de
  610.     inc    de
  611.     jr    opts1
  612. opts2:
  613.     ex    de,hl        ; USE HL
  614.     inc    hl        ; GET ADDRESS
  615.     ld    a,(hl)        ; GET LOW
  616.     inc    hl
  617.     ld    h,(hl)        ; GET HIGH
  618.     ld    l,a        ; PUT LOW
  619.     ex    de,hl        ; DE PTS TO OPTION ADDRESS, HL TO NEXT BYTE
  620.     ld    bc,opts        ; SET UP RETURN ADDRESS
  621.     push    bc
  622.     push    de        ; SET UP OPTION ADDRESS
  623.     ret            ; "RUN" OPTION
  624. ;
  625. ;  Option table
  626. ;
  627. otab:
  628.     db    'D'        ; Test dates only
  629.     dw    sdonlyf
  630.     db    'I'
  631.     dw    signorf
  632.     db    'M'        ; Multiple run
  633.     dw    smultf
  634.     db    'Q'        ; Quiet
  635.     dw    squietf
  636.     db    'V'        ; Verbose
  637.     dw    sverbf
  638.     db    0        ; End of table
  639. ;
  640. ;  Set use dates only
  641. ;
  642. sdonlyf:
  643.     ld    a,(donlyd)
  644.     cpl            ; Reverse default
  645.     ld    (donly),a
  646.     ret
  647. ;
  648. ; Set ignore date flag
  649. ;
  650. signorf:    
  651.     ld    a,(ignord)
  652.     cpl            ; Reverse default
  653.     ld    (ignor),a
  654.     ret
  655. ;
  656. ;  Set multiple run flag
  657. ;
  658. smultf:
  659.     ld    a,(multd)
  660.     cpl            ; Reverse default
  661.     ld    (mult),a
  662.     ret
  663. ;
  664. ;  Set DIFF quiet flag
  665. ;
  666. squietf:
  667.     ld    a,(quietd)
  668.     cpl            ; Reverse default
  669.     ld    (quiet),a
  670.     ret
  671. ;
  672. ;  Set verbose flag
  673. ;
  674. sverbf:
  675.     ld    a,(verbd)
  676.     cpl            ; Reverse default
  677.     ld    (verb),a
  678.     ret
  679. ;
  680. ;  Skip to non-blank char
  681. ;
  682. sblank:
  683.     ld    a,(hl)        ; GET CHAR
  684.     inc    hl        ; PT TO NEXT
  685.     cp    ' '        ; BLANK?
  686.     jr    z,sblank
  687.     dec    hl        ; PT TO NON-BLANK
  688.     ret
  689.  
  690. ; ------------------------------------------------
  691. ;
  692. ;  Print help message
  693. ;
  694. prhelp:
  695.     call    banner1        ; PRINT BANNER
  696.     call    print
  697.     db    cr,lf
  698.     db    '  Syntax:',cr,lf
  699.     db    tab,'DIFF /',tab,tab,tab,tab,tab,'- help',cr,lf
  700.     db    tab,'DIFF [dir:]ufn [dir:][ufn] [/][options]'
  701.     db    tab,'- compare',cr,lf
  702.     db    '  Options:',cr,lf,0
  703.     call    dostyp            ; Extended BDOS?
  704.     jr    z,prhelp1        ; No
  705.     cp    'S'            ; Yes
  706.     jr    z,prhelp2        ; Ok if ZSDOS,
  707.     cp    'D'
  708.     jr    z,prhelp2        ; ..or ZDDOS..
  709.     jr    prhelp3            ; Else forget it
  710. prhelp1:
  711.     ld    a,(cpmver)        ; We have CP/M
  712.     cp    30h            ; Plus?
  713.     jr    c,prhelp3        ; No
  714. prhelp2:
  715.     call    print
  716.     db    tab,'D - test Datestamps only',tab,tab,0    ; tab to col 49
  717.     ld    a,(donlyd)
  718.     call    printd            ; Show patched default
  719.     call    print
  720.     db    tab,'I - Ignore datestamps',tab,tab,tab,0
  721.     ld    a,(ignord)
  722.     call    printd
  723. prhelp3:
  724.     call    print
  725.     db    tab,'M - Multiple runs with disk change',tab,0
  726.     ld    a,(multd)
  727.     call    printd
  728.     call    print
  729.     db    tab,'Q - Quiet',tab,tab,tab,tab,0
  730.     ld    a,(quietd)
  731.     call    printd
  732.     call    print
  733.     db    tab,'V - Verbose',tab,tab,tab,tab,0
  734.     ld    a,(verbd)    
  735.     call    printd
  736.     call    print
  737.     db    '  Results stored in Program Error Flag and Register 0.'
  738.     db    0
  739.     jp    quitlf
  740. ;
  741. ; PRINTD - Show default option in help screen.
  742. ;
  743. ;    0 = (off)
  744. ;
  745. printd:
  746.     or    a
  747.     jr    z,prind1    ; Off if zero, else on
  748.     call    print
  749.     db    '(on)',cr,lf,0
  750.     ret
  751. prind1:
  752.     call    print
  753.     db    '(off)',cr,lf,0    
  754.     ret
  755.  
  756. ; ---------------------------------------------------
  757. ;
  758. ;  Check for any question marks from HL+1 to HL+11
  759. ;  Affect only AF registers if OK
  760. ;
  761. qcheck:
  762.     push    hl        ; SAVE HL
  763.     push    bc        ; SAVE BC
  764.     inc    hl        ; PT TO FIRST CHAR
  765.     ld    b,11        ; 11 BYTES
  766.     ld    c,'?'        ; SCAN FOR '?'
  767. qc:
  768.     ld    a,(hl)        ; GET BYTE
  769.     cp    c        ; '?'?
  770.     jr    z,qc1
  771.     inc    hl        ; PT TO NEXT
  772.     dec    b        ; COUNT DOWN
  773.     jr    nz,qc
  774.     pop    bc        ; RESTORE
  775.     pop    hl
  776.     ret
  777. qc1:
  778.     pop    bc        ; RESTORE AND ABORT
  779.     pop    hl
  780.     pop    de        ; DROP RETURN ADDRESS
  781.  
  782. ;    fall    thru
  783.  
  784.     ld    a,ecambig    ; Ambiguous file spec. error
  785. ;
  786. ; Chain to Z33 error handler.
  787. ; Set error, ECP, and external program bits of command status flag
  788. ;  to tell CCP there is an error, to go straight to the error handler 
  789. ;  (not the ECP), and not to alter the command error byte at z3msg+0:
  790. ;
  791. z33err:
  792.     call    retcst        ; Z33LIB return command status byte 
  793.     ld    (hl),00001110b
  794.     call    puter3        ; Z33LIB set command error byte
  795.     jp    quit        ; Return to CCP with bits set
  796.  
  797. ; -------------------------------------------------
  798. ;
  799. ;  Print banner
  800. ;
  801. banner:
  802.     call    qtest
  803.     ret    nz        ; Don't print if quiet
  804. banner1:
  805.     call    print
  806.     db    cr,lf
  807.     db    'DIFF, Version ',vers/10+'0','.',(vers mod 10)+'0'
  808.     db    ' - Compare files (loaded at ',0
  809.     ld    hl,(loadadr)
  810.     call    phl4hc
  811.     call    print
  812.     db    'h)'
  813.     db    0
  814.     ret
  815.  
  816. ; ----------------------------------------------------
  817. ;
  818. ;  Print names of source files
  819. ;    PRS1 -- source file 1
  820. ;    PRS2 -- source file 2
  821. ;
  822. prs1:
  823.     call    qtest
  824.     ret    nz
  825. prs1a:
  826.     call    print
  827.     db    cr,lf,' Source 1: ',0
  828.     ld    hl,sdisk    ; PT TO FIRST BYTE
  829.     call    prud
  830.     ld    de,fcb1        ; SOURCE FCB
  831.     jp    prfna        ; PRINT FILE NAME
  832.  
  833. prs2:
  834.     call    qtest
  835.     ret    nz
  836. prs2a:
  837.     call    print
  838.     db    cr,lf,' Source 2: ',0
  839.     ld    hl,ddisk    ; PT TO FIRST BYTE
  840.     call    prud
  841.     ld    de,fcbd        ; DESTINATION FCB
  842.     jp    prfna        ; PRINT FILE NAME
  843.  
  844. ; ---------------------------------------------
  845. ;
  846. ;    MAIN VERIFY ROUTINE
  847. ;
  848. verify:
  849.     ld    a,(quiet)
  850.     ld    b,a
  851.     ld    a,(verb)
  852.     or    b        ; Quiet or verbose mode?
  853.     call    z,prdot        ; No, show progress with '.'
  854. ;
  855.     ld    hl,buff1    ; Point for load
  856.     push    hl        ; SAVE PTR
  857.     call    logs        ; LOG IN SOURCE 1
  858.     ld    de,fcb1        ; SOURCE 1 FCB
  859.     call    load        ; READ IN BLOCK
  860.     ld    a,(bcnt)    ; GET OLD BLOCK COUNT
  861.     ld    (bcnt1),a    ; SAVE IT - bcnt1 stores blocks for fcb1
  862.     ld    hl,buff2    ; Point for load
  863.     push    hl        ; SAVE PTR
  864.     call    logd        ; LOG IN SOURCE 2
  865.     ld    de,fcbd        ; SOURCE 2 FCB
  866.     call    load        ; READ IN BLOCK
  867.     pop    de        ; DE PTS TO BUFF 2
  868.     pop    hl        ; HL PTS TO BUFF 1
  869.     ld    a,(bcnt)    ; CHECK FOR NO BLOCK READ - bcnt = fcbd blks
  870.     ld    b,a
  871.     ld    a,(bcnt1)
  872.     or    b
  873.     ret    z        ; DONE IF NONE READ
  874. ;
  875. ;  Verify loaded buffers by comparing them and printing differences
  876. ;
  877. verblock:
  878.     call    condin        ; Get input, if any
  879.     cp    ctrlc        ; Abort?
  880.     jp    z,dabort
  881.     ld    b,128        ; SCAN ONE BLOCK
  882. verbl:
  883.     ld    a,(de)        ; GET BYTE
  884.     cp    (hl)        ; COMPARE
  885.     call    nz,nomatch    ; PRINT DIFFERENCE or quit
  886.     inc    ix        ; Inc offset <crw>
  887.     inc    hl        ; PT TO NEXT
  888.     inc    de
  889.     djnz    verbl        ; Count down bytes
  890. ;
  891.     ld    a,(bcnt)    ; COUNT DOWN blocks
  892.     dec    a
  893.     ld    (bcnt),a
  894.     ld    a,(bcnt1)
  895.     dec    a
  896.     ld    (bcnt1),a
  897.     jr    z,vereq
  898.     ld    a,(bcnt)    ; CHECK FIRST BUFFER COUNT
  899.     or    a
  900.     jr    nz,verblock    ; CONTINUE COMPARE IF NOT EMPTY
  901. vereq:
  902.     ld    a,(bcnt)    ; CHECK FOR BOTH DONE
  903.     ld    b,a
  904.     ld    a,(bcnt1)
  905.     or    b        ; IF ZERO, BOTH DONE AT SAME TIME AND CONTINUE
  906.     jp    z,verify
  907.  
  908.     ld    a,(bcnt1)    ; CHECK FOR ONE DONE BEFORE THE OTHER
  909.     or    a        ; 2ND DONE?
  910.     ld    c,'1'        ; GET LETTER
  911.     jr    z,done1
  912.     ld    c,'2'        ; GET LETTER
  913.  
  914. ;  One file is shorter than the other -- say so and quit or return
  915.  
  916. done1:
  917.     call    qtest
  918.     jp    nz,quit        ; Don't print if quiet
  919.  
  920.     call    print
  921.     db    cr,lf,' Source ',0
  922.     ld    a,c
  923.     call    cout        ; PRINT LETTER
  924.     call    print
  925.     db    ' has terminated prematurely',0
  926.  
  927. cabort:                ; Abort this compare
  928.     ld    a,0ffh
  929.     ld    (first),a    ; Flag shows files were different
  930.     call    print
  931.     db    cr,lf,' Files are different',0
  932.     ret            ; Back for next or quit
  933. ;
  934. ;  Match error
  935. ;
  936. nomatch:
  937.     call    qtest
  938.     jp    nz,quit        ; Don't print if quiet
  939. ;
  940.     ld    a,(verb)    ; Get verbose flag
  941.     or    a        ; Z=simple compare
  942.     jr    nz,nmat0
  943.     pop    hl        ; Drop return address (VERIFY)
  944.     jr    cabort        ; Abort or back for next
  945. nmat0:
  946.     push    hl        ; SAVE REGS
  947.     push    de
  948.     push    bc
  949.     ld    a,(first)    ; FIRST TIME THRU?
  950.     or    a        ; 0=YES
  951.     jp    z,nmat3
  952.     ld    a,(lcnt)    ; CHECK FOR NEW SCREEN
  953.     or    a        ; ZERO IF DONE
  954.     jp    nz,nmat4
  955.     call    print
  956.     db    cr,lf,' DIFF: Strike RETURN to Continue, ^C to Abort',0
  957.     ld    a,(mult)    ; In multiple run?
  958.     or    a
  959.     jr    z,nmat1        ; No
  960.     call    print
  961.     db    ', or ^X to Advance',0
  962. nmat1:    call    print
  963.     db    ' - ',0
  964.     call    cin        ; GET RESPONSE
  965.     cp    ctrlc        ; ABORT?
  966.     jr    z,nmat2
  967.     cp    ctrlx        ; ADVANCE?
  968.     jp    nz,nmat3    ; No
  969.     ld    a,(mult)    ; Yes, see if multiple run
  970.     or    a
  971.     jp    z,nmat3        ; No, ignore ^x
  972.     pop    bc        ; Yes, advance.  CLEAR REGS
  973.     pop    de
  974.     pop    hl
  975.     pop    de        ; CLEAR STACK
  976.     call    print
  977.     db    cr,lf,' DIFF Advancing',0
  978.     ret            ; RETURN TO VERIFY CALLER
  979. nmat2:
  980.     pop    bc        ; CLEAR REGS
  981.     pop    de
  982.     pop    hl
  983. dabort:    pop    de        ; Clear stack
  984. dabort1:call    print
  985.     db    cr,lf,' DIFF Aborting',0
  986. quitlf:    ld    a,cr        ; Quit with CRLF
  987.     call    qcout
  988.     ld    a,lf
  989.     call    qcout
  990. quit:    ld    sp,(stksav)
  991.     ret            ; RETURN TO OPSYS
  992. nmat3:
  993.     ld    a,0ffh        ; CLEAR FIRST TIME FLAG
  994.     ld    (first),a
  995.     call    header        ; PRINT HEADING AND RETURN NEW LINE COUNT
  996. nmat4:
  997.     dec    a        ; COUNT DOWN 1 LINE
  998.     ld    (lcnt),a    ; NEW LINE COUNT
  999.     call    crlf
  1000.     push    hl        ; SAVE HL
  1001.     push    ix        ; Get offset to HL
  1002.     pop    hl
  1003.     call    phl4hc        ; PRINT AS HEX
  1004.     call    spacer        ; PRINT SPACES
  1005.     call    phldc        ; PRINT AS DEC
  1006.     pop    hl        ; RESTORE HL
  1007.     call    spacer
  1008.     call    spacer
  1009.     ld    a,' '
  1010.     call    cout
  1011.     ld    a,(hl)        ; GET SOURCE 1 VALUE
  1012.     call    prval        ; PRINT AS HEX, DEC, ASCII
  1013.     call    spacer        ; 10 SPACES
  1014.     call    spacer
  1015.     call    spacer
  1016.     call    spacer
  1017.     call    spacer
  1018.     ld    a,(de)        ; GET SOURCE 2 VALUE
  1019.     call    prval        ; PRINT AS HEX, DEC, ASCII
  1020.     pop    bc        ; RESTORE REGS
  1021.     pop    de
  1022.     pop    hl
  1023.     ret
  1024.  
  1025. ; ----------------------------------------------
  1026.  
  1027. ;  Print header and return new line count in A
  1028.  
  1029. header:
  1030.     push    de        ; SAVE REGS
  1031.     push    hl
  1032.     call    print
  1033.     db    cr,lf,' Rel Offset   ',0
  1034.     ld    hl,sdisk    ; PRINT DISK/USER
  1035.     call    prud
  1036.     ld    de,fcb1
  1037.     call    prfn        ; PRINT FILE NAME
  1038.     call    spacer        ; 5 SPACES
  1039.     call    spacer
  1040.     ld    hl,ddisk    ; PRINT DISK/USER
  1041.     call    prud
  1042.     ld    de,fcbd
  1043.     call    prfn        ; PRINT FILE NAME
  1044.     call    print
  1045.     db    cr,lf,' Hex    Dec       Hex  Dec Asc           Hex  Dec Asc',0
  1046.     ld    a,(lset)    ; SET LINE COUNT
  1047.     sub    1        ; ADJUST FOR HEADING AND FOOTER
  1048.     ld    (lcnt),a
  1049.     pop    hl
  1050.     pop    de        ; RESTORE REGS
  1051.     ret
  1052.  
  1053. ; ------------------------------------
  1054.  
  1055. ; Print A as hex, dec, and ASCII
  1056.  
  1057. prval:
  1058.     call    spacer        ; 3 SPACES
  1059.     call    space1
  1060.     call    pa2hc        ; PRINT AS HEX
  1061.     call    spacer
  1062.     call    padc        ; PRINT AS DEC
  1063.     call    spacer
  1064.     and    7fh        ; MASK OUT MSB
  1065.     cp    7fh        ; DOT FOR <DEL>
  1066.     jr    z,prdot
  1067.     cp    ' '        ; PRINT DOT IF LESS THAN <SP>
  1068.     jp    nc,cout
  1069. prdot:
  1070.     ld    a,'.'        ; PRINT DOT
  1071.     jp    cout
  1072.  
  1073. ; -----------------------------
  1074.  
  1075. ;  Print 2 spaces
  1076.  
  1077. spacer:
  1078.     call    space1
  1079. space1:
  1080.     push    af
  1081.     ld    a,' '
  1082.     call    qcout
  1083.     pop    af
  1084.     ret
  1085.  
  1086. ; --------------------------------------------------------
  1087. ;
  1088. ;  Load buffer at HL from file whose FCB is pted to by DE
  1089. ;    On output, bcnt=number of blocks loaded (up to blimit)
  1090. ;
  1091. load:
  1092.     xor    a        ; A=0
  1093.     ld    (bcnt),a    ; SET BLOCK COUNT
  1094.  
  1095. ;  Main load loop
  1096.  
  1097. load1:
  1098.     call    setdma        ; To (hl)
  1099.     call    f$read        ; READ A BLOCK
  1100.     or    a        ; END OF FILE?
  1101.     ret    nz        ; RETURN IF DONE
  1102.  
  1103.     ld    bc,128
  1104.     add    hl,bc        ; Point to next block
  1105.     ld    a,(bcnt)    ; GET BLOCK COUNT
  1106.     inc    a        ; INCREMENT IT
  1107.     ld    (bcnt),a    ; SET IT
  1108.     cp    blimit        ; LAST BLOCK READ?
  1109.     jr    nz,load1
  1110.     ret
  1111.  
  1112. ; ----------------------------------------------------------
  1113. ;
  1114. ;  Log in source (logs) and destination (logd) drives/users
  1115. ;
  1116. logs:
  1117.     ld    a,(sdisk)    ; GET DISK
  1118.     dec    a        ; A=0
  1119.     ld    b,a
  1120.     ld    a,(suser)    ; GET USER
  1121.     ld    c,a
  1122.     call    logud        ; LOG IN
  1123.     ret
  1124. logd:
  1125.     ld    a,(ddisk)    ; GET DISK
  1126.     dec    a        ; A=0
  1127.     ld    b,a
  1128.     ld    a,(duser)    ; GET USER
  1129.     ld    c,a
  1130.     call    logud        ; LOG IN
  1131.     ret
  1132.  
  1133. ; -----------------------------------------------
  1134. ;
  1135. ;  Print disk/user pted to by HL (2 bytes)
  1136. ;
  1137. prud:
  1138.     ld    a,(hl)        ; GET DISK
  1139.     add    a,'A'-1        ; CONVERT TO LETTER
  1140.     call    cout
  1141.     inc    hl        ; PT TO USER
  1142.     ld    a,(hl)        ; GET USER
  1143.     call    padc        ; PRINT AS DEC
  1144.     call    print
  1145.     db    ': ',0
  1146.     ret
  1147.  
  1148. ; ----------------------------------------------
  1149. ;
  1150. ;  Print file name whose fcb is pted to by DE
  1151. ;
  1152. prfn:
  1153.     call    qtest
  1154.     ret    nz        ; Don't print if quiet
  1155. prfna:
  1156.     push    hl        ; SAVE REGS
  1157.     push    de
  1158.     push    bc
  1159.     ex    de,hl        ; FN PTED TO BY HL
  1160.     inc    hl        ; PT TO FIRST CHAR
  1161.     ld    b,8        ; 8 CHARS
  1162.     call    prfn1
  1163.     ld    a,'.'
  1164.     call    cout
  1165.     ld    b,3        ; 3 CHARS FOR FILE TYPE
  1166.     call    prfn1
  1167.     call    space1
  1168.     pop    bc        ; RESTORE REGS
  1169.     pop    de
  1170.     pop    hl
  1171.     ret
  1172. prfn1:
  1173.     ld    a,(hl)        ; GET CHAR
  1174.     inc    hl        ; PT TO NEXT
  1175.     call    cout        ; PRINT
  1176.     dec    b        ; COUNT DOWN
  1177.     jr    nz,prfn1
  1178.     ret
  1179.  
  1180. ; ----------------------------------------------------
  1181.  
  1182. ; Special Quiet Output Routines for /Q option
  1183.  
  1184. ;
  1185. ; QTEST - Test quiet flag
  1186. ;
  1187. ;    Exit:    (NZ) if quiet active
  1188. ;    Uses:    - <F>
  1189. qtest:
  1190.     push    bc
  1191.     ld    b,a
  1192.     ld    a,(quiet)
  1193.     or    a        ; Set Z flag
  1194.     ld    a,b    
  1195.     pop    bc
  1196.     ret
  1197. ;
  1198. ; QCOUT - Print char. in A unless quiet option active
  1199. ;    Uses: <F>
  1200. ;
  1201. qcout:
  1202.     call    qtest
  1203.     ret    nz        ; Quit if quiet 
  1204.     jp    cout        ; Print char & return
  1205. ;
  1206. ; QPRDAT2 - Print date at HL, or just test if quiet option
  1207. ;
  1208. ;        Exit:    (Z) and A=0 if month ok.
  1209. ;            (NZ) and A=0FFh if not ok.
  1210. ;            Date printed if not quiet.
  1211. ;        Uses:    - <AF>
  1212. qprdat2:
  1213.     call    qtest
  1214.     jp    z,prdat2    ; Print & return if not quiet
  1215.  
  1216.     push    hl
  1217.     inc    hl        ; Test month
  1218.     ld    a,(hl)
  1219.     or    a
  1220.     jr    z,errexit
  1221.     cp    13h
  1222.     jr    nc,errexit
  1223.     xor    a        ; No error return
  1224.     jr    exit
  1225. errexit:
  1226.     or    0ffh        ; Error return
  1227. exit:
  1228.     pop    hl
  1229.     ret
  1230.  
  1231. ; =================================================
  1232. ;
  1233. ;    DATA AREAS
  1234. ;
  1235. ; Initialized data
  1236. ;
  1237. cstring:
  1238.     db    ' - created ',0
  1239. mstring:
  1240.     db    ' - last modified ',0 
  1241. dmatstr:
  1242.     db    ' File dates match ',0
  1243. twostr:
  1244.     db    ' Source 2 is more recent ',0
  1245. onestr:
  1246.     db    ' Source 1 is more recent ',0
  1247.  
  1248. ; ------------------------------------------------
  1249. ;
  1250. ;  Uninitialized RAM
  1251. ;
  1252.     DSEG
  1253.  
  1254. ; The next five data items must be contiguous and in the same
  1255. ; order as the patchable default options at label DONLYD.
  1256.  
  1257. donly:    ds    1        ; Test datstamps only (0=test data also)
  1258. ignor:    ds    1        ; Ignore dates flag (0=use dates)
  1259. mult:    ds    1        ; Multiple run flag (0=no mult runs)
  1260. quiet:    ds    1        ; Quiet mode (0=not quiet)
  1261. verb:    ds    1        ; Verbose flag (0=simple compare)
  1262.  
  1263. names:    ds    1        ; 0=names match
  1264.  
  1265. smodok:    ds    1        ; Source modify year flag
  1266. dmodok:    ds    1        ; Dest.
  1267. offset:    ds    2        ; RELATIVE OFFSET
  1268.  
  1269. first:    ds    1        ; ERROR INDIC
  1270.  
  1271. lset:    ds    1        ; NUMBER OF TEXT LINES ON SCREEN
  1272. lcnt:    ds    1        ; LINE COUNT
  1273.  
  1274. sdisk:    ds    1        ; SOURCE DISK (MUST BE FOLLOWED BY SUSER)
  1275. suser:    ds    1        ; SOURCE USER
  1276.  
  1277. ddisk:    ds    1        ; DEST DISK (MUST BE FOLLOWED BY DUSER)
  1278. duser:    ds    1        ; DEST USER
  1279.  
  1280. fcbd:    ds    36        ; DESTINATION FCB
  1281.  
  1282. bcnt:    ds    1        ; BUFFER COUNT
  1283. bcnt1:    ds    1        ; SECOND BUFFER COUNT
  1284.  
  1285. sdatbuf:            ; Buffer for 1st file's stamp <crw>
  1286.     ds    10        ; Create, access stamps
  1287. smodbuf:ds    5        ; Modify stamp
  1288.     ds    113        ; For future ZSDOS compat.
  1289.  
  1290. ddatbuf:
  1291.     ds    10        ; Create, access stamps
  1292. dmodbuf:ds    5        ; Modify stamp
  1293.     ds    113
  1294.  
  1295. stksav:    ds    2        ; Entry stack
  1296.     ds    60        ; Local stack
  1297. ourstk:
  1298.  
  1299. buff1:
  1300.     ds    bsize+1        ; File compare buffers 
  1301. buff2:
  1302.     ds    bsize+1
  1303.  
  1304.     end
  1305.  
  1306. ; END DIFF.Z80
  1307.