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 / BEEHIVE / ZSUS / ZSUS001.LBR / MOVE22.LBR / MOVE22.ZZ0 / MOVE22.Z80
Text File  |  1989-12-03  |  16KB  |  734 lines

  1.  
  2. ; Program: MOVE
  3. ; Author: Joe Wright
  4. ; Date: 28 February 1986
  5. ; Version: 2.0
  6.  
  7. vers    equ    22        ; Fixed bug in handling of large
  8.                 ; files.  Needed to set S2, not s1 wild.
  9.                 ; Modified move algorithm for increased
  10.                 ; speed.  Now uses "search next" and
  11.                 ; does only one write per directory
  12.                 ; sector per file instead of possibly
  13.                 ; four.
  14.                 ; Cleaned up command line parsing code.
  15.                 ; Removed special handling for stand-
  16.                 ; alone user numbers as DUSCAN seems
  17.                 ; to do it right.  Shortened code in
  18.                 ; SCANER: and fixed IFCBG: to work with
  19.                 ; extended environment.  Shortened code
  20.                 ; in several other places as well.
  21.                 ; Added a call to FRESET just before
  22.                 ; deleting a file in the destination
  23.                 ; area to avoid problems when running
  24.                 ; under DRI BDOS.
  25.                 ; Added conditional assembly for type 4.
  26.                 ; December 4, 1989  Howard Goldstein
  27. ;
  28. ;vers    equ    21    ; "B" version, one Bridger hint, one bug fix.
  29.             ; Wildcard to both extent bytes before file
  30.             ; existence test in "mainloop:", clear carry
  31.             ; flag before the "sbc hl,de" a little after 
  32.             ; the call to "eval10".
  33.             ; December 31, 1987    Bruce Morgen
  34.             ; "A" version, incorporated Bridger's FRESET
  35.             ; December 30, 1987    Bruce Morgen
  36.             ; ZCPR33 Type 3 format with safety header, search
  37.             ; for an empty user area instead of bombing out
  38.             ; everything in user 31, established DSEG - with
  39.             ; initialization to assure predictable re-entrance.
  40.             ; Fixed wildcard FCB (had too many "?"s).  Allow
  41.             ; legitimate DU/DIR destination specs without
  42.             ; colons, ditto standalone user numbers.  Added
  43.             ; intelligent help message (change name to MAKE or
  44.             ; MV, help also changes).  Scanning code ATTEMPTS
  45.             ; to following all Z33/BGii stipulations where
  46.             ; applicable....
  47.             ; December 28, 1987    Bruce Morgen
  48.  
  49. ;vers    equ    20    ; Fixed drive selection bug. Add Query as default
  50.             ; option. Report directories in DU:DIR form.
  51.             ;  28 Feb 86  jww
  52.  
  53. z3env    equ    0
  54.     .accept    'Program type (3 or 4) ',type
  55.  
  56. biosv    equ    001h
  57. fcb1    equ    05ch
  58. usr1    equ    fcb1+13
  59. fcb2    equ    06ch
  60. usr2    equ    fcb2+13
  61. tbuf    equ    080h
  62.  
  63. tab    equ    9
  64. cr    equ    13
  65. lf    equ    10
  66.  
  67.     ext    z33chk,getccp,freset
  68.     ext    z3init,cout,dutdir,dnscan,duscan,dirscan,getefcb
  69.     ext    pafdc,prttype,eprint,pfn1,bdos
  70.     ext    caps,cin,hfilb,fillb,@fncmp
  71.  
  72.  
  73. ; TYPE 3 HEADER
  74.  
  75. ; Code modified as suggested by Charles Irvine to function correctly with
  76. ; interrupts enabled.  Program will abort with an error message when not
  77. ; loaded to the correct address (attempt to run it under CP/M or Z30).
  78.  
  79. entry:
  80.      if type eq 3
  81.     jr    start0            ; Must use relative jump
  82.     nop                ; Filler
  83.      else
  84.     rst    0
  85.     dw    start
  86.      endif
  87.  
  88.     db    'Z3ENV'
  89. z3type:    db    type
  90. z3eadr:
  91.     dw    z3env            ; Filled in by Z33
  92.     dw    entry            ; Intended load address
  93.  
  94.      if type eq 3
  95. start0:
  96.     ld    hl,0            ; Point to warmboot entry
  97.     ld    a,(hl)            ; Save the byte there
  98.     di                ; Protect against interrupts
  99.     ld    (hl),0c9h        ; Replace warmboot with a return opcode
  100.     rst    0            ; Call address 0, pushing RETADDR
  101.                     ; onto stack
  102. retaddr:
  103.     ld    (hl),a            ; Restore byte at 0
  104.     dec    sp            ; Get stack pointer to point
  105.     dec    sp            ; To the value of RETADDR
  106.     pop    hl            ; Get it into HL and restore stack
  107.     ei                ; We can allow interrupts again
  108.     ld    de,retaddr        ; This is where we should be
  109.     xor    a            ; Clear carry flag
  110.     push    hl            ; Save address again
  111.     sbc    hl,de            ; Subtract -- we should have 0 now
  112.     pop    hl            ; Restore value of RETADDR
  113.     jr    z,start            ; If addresses matched, begin real code
  114.  
  115.     ld    de,notz33msg-retaddr    ; Offset to message
  116.     add    hl,de
  117.     ex    de,hl            ; Switch pointer to message into DE
  118.     ld    c,9
  119.     jp    0005h            ; Return via BDOS print string function
  120. notz33msg:
  121.     db    'Not Z33+$'        ; Abort message if not Z33-compatible
  122.         endif
  123.  
  124.  
  125. start:    ld    (stack),sp
  126.     ld    sp,stack
  127.     ld    a,'Q'
  128.     ld    (option),a
  129.     ld    a,32
  130.     ld    (empusr),a
  131.     ld    hl,fcbwild
  132.     ld    (hl),0
  133.     inc    hl
  134.     ld    b,11
  135.     ld    a,'?'
  136.     call    hfilb
  137.     xor    a
  138.     ld    b,4
  139.     call    fillb
  140.     ld    c,12        ; Get dos version
  141.     call    bdos
  142.     cp    30h
  143.     jp    z,baddos    ; Cant run under CP/M+
  144.  
  145.     ld    hl,(z3eadr)
  146.     LD    A,H
  147.     OR    L
  148.     JP    Z,BADDOS    ; Must have a Z3 environment
  149.     call    z3init        ; initialize the environment
  150. ;
  151. ; Turn off PUBLIC
  152. ;
  153.     ld    de,126
  154.     add    hl,de        ; point to PUBLIC bytes
  155.     ld    e,(hl)
  156.     inc    hl
  157.     ld    d,(hl)
  158.     ld    (public),de    ; save them
  159.     xor    a
  160.     ld    (hl),a
  161.     dec    hl
  162.     ld    (hl),a        ; Turn public off
  163.     ld    hl,fcb1+1
  164.     ld    a,(hl)
  165.     cp    ' '
  166.     jp    z,help        ; Invoked without command tail
  167.     cp    '/'
  168.     jr    nz,gotname
  169.     inc    hl
  170.     ld    a,(hl)
  171.     cp    '/'
  172.     jp    z,help        ; Help is asked for
  173. ;
  174. ;  Search for options
  175. ;
  176. gotname:
  177.     ld    hl,tbuf+2    ; Beginning of command tail
  178. gotloop:
  179.     ld    a,(hl)        ; Get the character
  180.     inc    hl        ; Point to next
  181.     or    a
  182.     jr    z,got0        ; Use default options
  183.     cp    '/'
  184.     jr    nz,gotloop    ; Try again
  185.     ld    a,(hl)        ; Get option character
  186.     cp    'O'        ; Overwrite option
  187.     jr    z,setopt
  188.     cp    'S'        ; Skip option
  189.     jr    z,setopt
  190.     cp    'Q'
  191.     jp    nz,invopt    ; Invalid option selected
  192. setopt:
  193.     ld    (option),a
  194. ;
  195. ;  Resolve Drive/User with ZCPR3 constructs
  196. ;
  197. got0:
  198.     ld    a,(fcb2+15)    ; Check for valid z33 parse
  199.     or    a
  200.     jr    nz,jpinvdu    ; Complain immediately if we detect it
  201.     ld    a,(fcb1+15)
  202.     or    a
  203.     jr    nz,jpinvdu
  204.     ld    a,(fcb1)    ; Source
  205.     dec    a        ; 0ffh if current drive, otherwise drvno.
  206.     call    m,getdsk    ; Return selected disk
  207.     ld    (drvno),a    ; Save drive number
  208.     ld    hl,fcb2+1    ; Point second FCB name area
  209.     ld    a,' '
  210.     cp    (hl)        ; Is it blank?
  211.     jr    nz,doscan    ; If not, go parse possible DU
  212.     dec    hl        ; Point back to drive byte
  213.     ld    a,(hl)
  214.     dec    a
  215.     call    m,getdsk    ; Via BDOS if necessary
  216.     ld    b,a        ; Stow in B
  217.     ld    a,(usr2)    ; Get CCP-parsed user code
  218.     ld    c,a        ; Into C
  219. got1:    ld    a,(usr1)
  220.     ld    (srcusr),a
  221.     cp    c
  222.     jr    z,jpinvdu    ; Users must be different
  223.     ld    a,c
  224.     ld    (desusr),a
  225.     ld    a,(drvno)
  226.     cp    b
  227.     jr    nz,jpinvdu    ; Drives must be the same
  228.     ld    c,14        ; Select drive
  229.     ld    e,a
  230.     call    bdos
  231.     jr    search0
  232. ;
  233. doscan:    call    scaner        ; Parse du or dir
  234.     jr    nz,got1        ; Use that if successful
  235. jpinvdu:
  236.     jp    invdu
  237. ;
  238. search0:
  239. ;
  240. ;  Find a scratchpad user area
  241. ;
  242.     ld    hl,desusr
  243.     ld    a,(empusr)
  244. search1:
  245.     dec    a
  246.     jp    m,usfail
  247.     cp    (hl)
  248.     jr    z,search1
  249.     ld    (empusr),a
  250.     call    gsuser
  251.     ld    de,fcbwild    ; All wildcards
  252.     call    searchf
  253.     jr    nz,search0
  254.  
  255. ;
  256. ;  Confirm file existence
  257. ;
  258. userok:
  259.     ld    a,(srcusr)
  260.     call    gsuser
  261.     ld    de,fcb1
  262.     call    searchf
  263.     jp    z,nofile
  264.     ld    a,(fcb1+7)    ; Get "found via ZDOS public" flag
  265.     bit    7,a
  266.     jp    nz,nofile    ; File considered not found if so
  267.  
  268. ;
  269. ;  Check for CON: abort, then do per-file main loop
  270. ;
  271. mainloop:
  272.     ld    c,6        ; Direct console input
  273.     ld    e,0ffh
  274.     call    bdos
  275.     cp    3        ; Control C?
  276.     jp    z,abort
  277.     ld    de,fcb1
  278.     call    searchf        ; Search First function
  279.     jp    z,quit        ; No more found
  280.     call    findir        ; Point to specific entry in tbuf
  281.     ld    bc,16        ; Move 16 bytes
  282.     ld    de,fcbdrv
  283.     ldir
  284.     ld    a,(desusr)
  285.     call    gsuser
  286.     ld    a,(fcb1)    ; Drive number
  287.     ld    (fcbdrv),a    ; Replace user number from BDOS
  288.     ld    a,'?'        ; Wild card
  289.     ld    (fcb1+12),a
  290.     ld    (fcb1+14),a
  291.     ld    (fcbext),a    ; Make extents wild
  292.     ld    (fcbs2),a
  293.  
  294.     ld    de,fcbdrv
  295.     call    searchf
  296.     jp    nz,filexists    ; Bail out if file exists in destination
  297.  
  298.     call    eprint
  299.     db    cr,lf,' Moving ',0
  300.     ld    a,(srcusr)
  301.     call    pdir
  302.     ld    de,fcbname    ; Point to name
  303.     call    pfn1
  304.     call    eprint
  305.     db    ' to ',0
  306.     ld    a,(desusr)
  307.     call    pdir
  308.     ld    a,(srcusr)
  309.     call    gsuser
  310.     call    moveit
  311.     jr    mainloop
  312.  
  313. moveit:
  314.     ld    c,17        ; Start with "search first"
  315.     ld    de,fcbdrv
  316. ;
  317. ; At this point, de points to fcb and c contains function code
  318. ;
  319. mvt0:    call    search        ; Find matching entry
  320.     ret    z        ; Not this one, try again
  321.     ld    b,0        ; Init counter
  322.     call    findir        ; point hl to dir entry
  323. mvt1:    ld    a,(desusr)
  324.     ld    (hl),a        ; Replace current with destination
  325.     inc    b        ; Bump count of entries changed in this sector
  326.  
  327. ;
  328. ;  Check for additional matches in current dir sector
  329. ;
  330. mvt2:    ld    a,20h
  331.     add    a,l        ; Point to next entry
  332.     jr    z,mvt3        ; No more entries; write sector
  333.     ld    l,a
  334.     ld    a,(srcusr)    ; Source user
  335.     cp    (hl)        ; Compare with user in dir entry
  336.     jr    nz,mvt2
  337.  
  338.     push    hl        ; Save regs
  339.     push    de
  340.     push    bc
  341.     inc    hl        ; Point to filename
  342.     inc    de
  343.     ld    b,11        ; Compare 11 bytes (file name and type)
  344.     call    @fncmp
  345.     pop    bc
  346.     pop    de        ; restore pointers
  347.     pop    hl
  348.     jr    z,mvt1        ; Match.  Fix user number and check next
  349.     jr    mvt2        ; No match.  Check next entry
  350.  
  351. mvt3:    call    write        ; Write the buffer back to disk
  352.     call    sync        ; Do "search nexts" to keep in sync
  353.     jr    mvt0
  354.  
  355. ;
  356. ;  SYNC does "search next" calls to keep BDOS in sync with
  357. ;  additional changes we might have made in the directory sector.  On
  358. ;  entry, DE contains pointer to FCB and B contains the count of
  359. ;  searches necessary plus 1.  On exit DE still has the FCB pointer and
  360. ;  C contains 18, the function code for "search next" to be used by
  361. ;  the call to SEARCH at MVT0.
  362. ;
  363. SYNC:    LD    C,18        ; Search next code
  364.  
  365. syncloop:
  366.     dec    b        ; Count down
  367.     ret    z        ; Exit if no more
  368.     call    bdos        ; Do function
  369.     jr    syncloop    ; ..and loop back
  370.  
  371. ;
  372. ;  PDIR prints the drive, user and directory name
  373. ;
  374. pdir:    ld    c,a        ; Store user number in c
  375.     ld    a,(drvno)        ; Get drive
  376.     ld    b,a        ; ..and store in b
  377.     add    a,'A'
  378.     call    cout
  379.     ld    a,c
  380.     call    pafdc
  381.     ld    a,':'
  382.     call    cout
  383.     call    dutdir        ; Attempt to find directory name
  384.     jr    nz,name        ; Found it
  385.     call    eprint
  386.     db    'Noname- ',0
  387.     ret
  388.  
  389. name:
  390.     ld    b,8        ; Print 8 chars max
  391. name1:    ld    a,(hl)        ; Get dir name char
  392.     call    cout        ; Print it
  393.     cp    ' '        ; Was it a space?
  394.     ret    z        ; Return if so
  395.     inc    hl
  396.     djnz    name1
  397.     ld    a,' '
  398.     jp    cout
  399.  
  400. ;
  401. ; Return current disk in A
  402. ;
  403. getdsk:
  404.     ld    c,25
  405.     jp    bdos
  406. ;
  407. ; Get/Set user function
  408. ;
  409. gsuser:
  410.     ld    c,32
  411.     ld    e,a
  412.     jp    bdos
  413. ;
  414. ;  Search For First function
  415. ;
  416. searchf:
  417.     ld    c,17
  418. search:    call    bdos
  419.     cp    0ffh
  420.     ret
  421. ;
  422. ;  Point hl to the found directory entry
  423. ;
  424. findir:
  425.     rrca
  426.     rrca
  427.     rrca
  428.     add    a,tbuf
  429.     ld    l,a
  430.     ld    h,0
  431.     ret
  432.  
  433. ;
  434. ; Bios Write function, preserve regs
  435. ;
  436. write:
  437.     push    bc
  438.     push    de
  439.     call    wrt1
  440.     pop    de
  441.     pop    bc
  442.     ret
  443.  
  444. wrt1:    ld    hl,(biosv)
  445.     ld    l,42        ; Bios write entry
  446.     ld    c,1        ; Directory write
  447.     jp    (hl)        ; Jump to bios, return to syncloop
  448.  
  449. ;
  450. ; Convert D, U, DU, or named DIR to drive in B, user in C
  451. scaner:
  452.     call    ifcbg        ; Running BGii? (Returns a=0 if so)
  453.     jr    z,scanjp    ; BG is always DU before DIR
  454.     call    z33chk        ; Running Z33 or later? (a=0 if so)
  455.     jr    nz,scanjp    ; If not Z33, assume dir first
  456.     push    hl        ; Save pointer
  457.     call    getccp        ; Get start of CCP
  458.     ld    de,7        ; Offset to the option flag
  459.     add    hl,de
  460.     ld    a,(hl)        ; Option flag to a
  461.     pop    hl        ; Restore pointer
  462.     bit    0,a        ; Do we take DU prefixes at all?
  463.     jr    nz,chkdir    ; If so, see if DIRs are also OK
  464.     and    10b        ; If not, DIR is our only hope
  465.     jp    nz,dirscan    ; OK, scan for DIR only
  466.     ret            ; Otherwise return Z for failure
  467. chkdir:    bit    1,a        ; Let's see if both DIR and DU
  468.     jp    z,duscan    ; If not, scan for DU only
  469.     and    100b        ; Isolate du-first bit
  470.     xor    100b        ; Invert (0 = du first)
  471. scanjp:    jp    dnscan        ; Central JP so we can use JRs
  472.  
  473. ; Adapted from Jay Sage's COMIF:
  474. ;
  475. ; Condition:  BG (BackGrounder)
  476. ;
  477. ; This option tests for the presence of the 'BGii' ID string that
  478. ; shows that BackGrounder ii is running.  The code looks for the
  479. ; ID at an offset of IDOFF from the beginning of the CPR code.    The
  480. ; value of IDOFF was determined by examination.
  481.  
  482. idoff    equ    5bh
  483.  
  484. ifcbg:
  485.     push    hl
  486.  
  487.     call    getccp        ; Point to beginning of ccp
  488.     ld    de,idoff    ; Offset to 'BGii' ID string in BG CPR
  489.     add    hl,de
  490.     ld    de,idstr    ; Point to reference ID string
  491.     ld    b,idlen        ; Length of ID string
  492. bgchk1:
  493.     ld    a,(de)        ; Get reference character
  494.     sub    (hl)        ; Compare to actual character
  495.     jr    nz,bgfals    ; Set false if mismatch
  496.     inc    hl        ; Move to next characters
  497.     inc    de
  498.     djnz    bgchk1        ; Loop through all characters
  499. bgfals:
  500.     pop    hl
  501.     ret
  502.  
  503. idstr:    db    'BGii'
  504. idlen    equ    [$-idstr]
  505.  
  506.  
  507. ;  Error message routines
  508.  
  509. invopt:
  510.     call    eprint
  511.     db    cr,lf,tab,'-- Invalid Option --',0
  512.     jp    help
  513.  
  514. invdu:
  515.     call    eprint
  516.     db    cr,lf,'-- Invalid Drive/User Selection --',0
  517.     jp    help
  518.  
  519. baddos:
  520.     call    eprint
  521.     db    '-- CP/M 2.2-compatible Z System required!'
  522.     db    cr,lf,0
  523.     jp    exit1
  524. abort:
  525.     call    eprint
  526.     db    cr,lf,tab,'-- Aborted --',0
  527.     jp    quit
  528.  
  529. nofile:
  530.     call    eprint
  531.     db    cr,lf,tab,'-- No Source File --',0
  532.     jp    exit
  533.  
  534. usfail:
  535.     call    eprint
  536.     db    cr,lf,'-- No Empty User Area On Drive --',0
  537.     jp    exit
  538.  
  539. filexists:
  540.     call    eprint
  541.     db    cr,lf,'  ',0
  542.     ld    a,(desusr)
  543.     call    pdir
  544.     ld    de,fcbname
  545.     call    pfn1
  546.  
  547.     ld    a,(option)
  548.     cp    'O'        ; Overwrite
  549.     jr    z,overwr
  550.     cp    'S'
  551.     jr    z,filex1
  552.     call    eprint
  553.     db    ' exists.  Move anyway? (Y or N)',0
  554.     call    cin        ; Wait for response
  555.     call    caps
  556.     cp    'Y'
  557.     jr    z,overwr
  558. ;
  559. ;  Move temporarily to scratchpad user area
  560. ;
  561. filex1:
  562.     ld    a,(desusr)
  563.     push    af        ; save it on the stack
  564.     ld    a,(empusr)
  565.     ld    (desusr),a    ; temporarily
  566.  
  567.     ld    a,(srcusr)
  568.     call    gsuser
  569.     call    moveit
  570.  
  571.     pop    af
  572.     ld    (desusr),a
  573.     call    eprint
  574.     db    '  NOT moved.',0
  575.     ld    a,255
  576.     ld    (wrflag),a
  577.     jr    filexex
  578.  
  579. overwr:
  580. ;
  581. ;  Reset drive and delete the destination file
  582. ;
  583.     ld    a,(drvno)
  584.     call    freset
  585.     ld    de,fcbdrv
  586.     ld    c,19
  587.     call    bdos
  588.  
  589.     call    eprint
  590.     db    '  Erased',0
  591. filexex:
  592.     ld    a,(srcusr)
  593.     call    gsuser
  594.     jp    mainloop
  595.  
  596. ;
  597. ;  Main and ONLY program exit
  598. ;
  599. quit:
  600.     ld    a,(wrflag)
  601.     or    a
  602.     jr    z,quit5
  603. ;
  604. ;  Move any files in scratchpad user area back to source
  605. ;
  606.     ld    a,(empusr)
  607.     call    gsuser
  608.     ld    c,17        ; Start with "search first"
  609.     ld    de,fcb1        ; use ambiguous fcb
  610. quit1:    call    search
  611.     jr    z,quit5        ; No entries left
  612.     ld    b,0        ; Init counter
  613.     call    findir        ; point hl to dir entry
  614. quit2:    ld    a,(srcusr)
  615.     ld    (hl),a        ; Replace current with destination
  616.     inc    b        ; Bump count of entries changed in this sector
  617. quit3:    ld    a,20h
  618.     add    a,l        ; Point to next entry
  619.     jr    z,quit4        ; No more entries; write sector
  620.     ld    l,a
  621.     ld    a,(empusr)    ; Scratch pad user
  622.     cp    (hl)        ; Compare with user in dir entry
  623.     jr    z,quit2    ; Match.  Fix user number and check next
  624.     jr    quit3        ; No match.  Check next entry
  625. quit4:    call    write        ; Write the buffer back to disk
  626.     call    sync        ; Do "search nexts" to keep in sync
  627.     jr    quit1
  628. quit5:
  629.     ld    a,(drvno)
  630.     call    freset
  631. exit:
  632. ;
  633. ;  Turn PUBLIC on again
  634. ;
  635.     ld    hl,(z3eadr)
  636.     ld    de,126
  637.     add    hl,de        ; Point to PUBLIC area
  638.     ld    de,(public)    ; Get original bytes
  639.     ld    (hl),e
  640.     inc    hl
  641.     ld    (hl),d
  642. exit1:
  643.     ld    sp,(stack)
  644.     ret
  645.  
  646.  
  647. help:
  648.     call    eprint
  649.     db    cr,lf,'MOVE Version '
  650.     db    vers/10+'0','.',vers mod 10+'0'
  651.     db    ' ',0
  652.     ld    hl,entry
  653.     ld    a,type
  654.     call    prttype
  655.     call    eprint
  656.     db    cr,lf,'Syntax:',cr,lf,' ',0
  657.     call    comnam
  658.     call    eprint
  659.     db    ' [dir1:]afn [dir2[:]] [/o]',cr,lf,lf,' ',0
  660.     call    comnam
  661.     call    eprint
  662.     db    ' afn dir[:]       Moves from current to dir:'
  663.     db    cr,lf,' ',0
  664.     call    comnam
  665.     call    eprint
  666.     db    ' dir:afn dir1[:]  Moves from dir: to dir1:'
  667.     db    cr,lf,' ',0
  668.     call    comnam
  669.     call    eprint
  670.     db    ' dir:afn        Moves from dir: to current.'
  671.     db    cr,lf,lf,'All directories must reference the same drive.'
  672.     db    cr,lf,'Options are: "Q"uery, "S"kip or "O"verwrite.'
  673.     db    cr,lf,'Duplicate entries will be Queried by default.'
  674.     db    cr,lf,lf,'Example: ',0
  675.     call    comnam
  676.     call    eprint
  677.     db    ' dir:afn dir1: /o to overwrite.'
  678.     db    cr,lf,0
  679.     jp    exit
  680.  
  681. ; Print actual COMfile name if we can,
  682. ; otherwise print "MOVE"
  683.  
  684. comnam:    call    getefcb
  685.     jr    z,noefcb
  686.     ld    b,8
  687. comnml:    inc    hl
  688.     ld    a,(hl)
  689.     and    7fh
  690.     cp    ' '
  691.     call    nz,cout
  692.     djnz    comnml
  693.     ret
  694. ;
  695. noefcb:    call    eprint
  696.     db    'MOVE',0
  697.     ret
  698. ;
  699. ; The following line is included so that the PRTTYPE routine will use
  700. ; EPRINT rather than causing PRINT to be linked in as well.
  701.  
  702. print::    jp    eprint
  703. ;___________________________
  704. ;
  705.     dseg
  706. wrflag:
  707.     ds    1
  708.  
  709. empusr:
  710.     ds    1
  711. srcusr:
  712.     ds    1
  713. drvno:
  714.     ds    1        ; Drive number
  715. desusr:
  716.     ds    1
  717. fcbwild:
  718.     ds    16
  719. fcbdrv:
  720.     ds    16
  721. fcbname    equ    fcbdrv+1
  722. fcbext    equ    fcbdrv+12
  723. fcbs2    equ    fcbdrv+14
  724.  
  725. option:
  726.     ds    1        ; Default to Query duplicate files
  727. public:
  728.     ds    2
  729.  
  730.     ds    48        ; Stack area
  731. stack:    ds    2        ; ZCPR3's stack
  732.  
  733.     end
  734.