home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / p / swapcopy.lbr / SWCPYPX.AZM / SWCPYPX.ASM
Encoding:
Assembly Source File  |  1993-10-25  |  15.4 KB  |  699 lines

  1. ;====================================================================
  2. ;                       PX-8 SWAPCOPY v2.3PX                |
  3. ;                                    |
  4. ;    A single drive file copy program for Kaypro NEW 2 & 10 models  |
  5. ;                     Written by Steve Sanders                    |
  6. ;    Revised for EPSON PX-8 / PF-10 use by Ted Nevels            |
  7. ;====================================================================
  8. ;
  9. ; Automatically sets logged drive for all copy operations.
  10. ;
  11. ; Added auto-input prompting. 
  12. ;
  13. ; This is the program EPSON --> SHOULD HAVE GIVEN EVERY PURCHASER 
  14. ; of a PF-10 disk drive.
  15. ;
  16. ;     Steve Sanders  Tampa, FL  01/06/84  (813) 937-7249 voice
  17. ;     (813) 937-3608   (813) 937-6829  data  300/1200  24 hrs
  18. ;....................................................................
  19. ;
  20. ; Allows files to be transfered from one diskette to
  21. ; another in a system with only a single drive.
  22. ;
  23. ; Allows ambiguous file specifications.
  24. ; Allows transfer of files larger than available memory,
  25. ; and transfer of multiple files in a single pass.
  26. ;
  27. ; Allows use of dissimiliar media (i.e., to copy
  28. ; programs from a single density master diskette
  29. ; to a double density working diskette).
  30. ;
  31. ;    Disk to disk file transfer program.
  32. ;
  33. ;    At the command level, the command:
  34. ;
  35. ;    D>SWCPYPX FILENAME.EXT <cr>
  36. ;
  37. ;    will copy the file FILENAME.EXT from diskette
  38. ;    to diskette, prompting as necessary to allow the
  39. ;    diskette in drive D to be swapped.
  40. ;
  41. ;  or...
  42. ;
  43. ;       D>SWCPYPX *.* <cr>
  44. ;
  45. ;       will prompt for each filename found on disk
  46. ;       with (y/n) and copy as many as possible into
  47. ;       memory and so on ...
  48. ;
  49. ;      ===================================================
  50. ;      ===  PROGRAM ABORTS IF NO FILE SPEC IS ENTERED  ===
  51. ;      ===================================================
  52. ;
  53. ;///////////////////////////////
  54. ;
  55. ; equates
  56. ;
  57. boot    equ       0    ;system reboot
  58. bdos    equ       5    ;bdos entry point
  59. memtop    equ       6    ;pointer to start of fbase
  60. fcb1    equ      5ch    ;first file name & source fcb
  61. fcb2    equ      6ch    ;second file name
  62. tpa    equ     100h    ;beginning of tpa
  63. ;
  64. false    equ       0
  65. true    equ     255
  66. ;
  67. esc    equ      27
  68. bell    equ       7
  69. clrscr    equ      42    ;clear screen/home cursor
  70. cntrlc    equ       3
  71. tab    equ       9
  72. lf    equ      10
  73. cr    equ      13
  74. secsiz    equ     128    ;bytes per sector
  75. ;
  76.     org    tpa    ;where else?
  77. ;
  78. swapcopy:
  79.     lxi    sp,stack;set up local stack space
  80. ;
  81.     mvi    a,false
  82.     sta    done    ;we're not done yet
  83.     sta    one2go    ;nor do we have a file to go
  84. ;
  85.     mvi    c,isdrv    ;get the current drive
  86.     call     bdos
  87.     sta    drive    ;store it
  88. ;
  89.     mvi    a,true
  90.     sta    rflag    ;report operations - yes
  91.     sta    qflag    ;query before copy - yes
  92. ;
  93.     lxi    h,buf+eofo
  94.     mvi    m,true    ;set initial eof to true
  95. ;
  96.     lhld    memtop
  97.     lxi    d,-(secsiz+freeo+8)
  98.     dad    d    ;highest availiable dma buffer
  99.     shld    buftop
  100. ;
  101.     lxi    h,buf
  102.     shld    fpbpnt    ;free space starts at buf
  103. ;
  104.     mvi    a,1
  105.     sta    names    ;initial next-names count
  106. ;
  107.     lxi    d,banner
  108.     call    print
  109. ;
  110.     lda    fcb1+1    ;check for filename or *.*
  111.     cpi    ' '    ;if none entered
  112.     jnz    sdisk    
  113.     lxi    d,nospec
  114.     jmp    abort    ;abort with error msg
  115. ;
  116. sdisk:    lxi    d,sourmx    ;or...
  117.     call    prompt    ;ask for the source disk
  118.     call    ffname    ;get the first matching file name
  119.     call    adjpnt
  120.     call    filfpb    ;set rdma & wdma pointers, fill in file name
  121.     call    query    ;is the first file to be copied?
  122.     jnc    nxtnam    ;if not, try the next file
  123.     mvi    a,true
  124.     sta    one2go    ;if so, set 'one to go' to true, then copy it
  125. ;
  126. rdloop:    lda    fileof
  127.     ana    a
  128.     jm    wr    ;start writing when the last file has been read
  129.     lhld    rdma
  130.     call    fulbuf
  131.     jc    wr    ; or when the buffer space has been exhausted
  132. ;
  133.     lhld    eof
  134.     mov    a,m
  135.     ana    a
  136.     jz    samfil    ;if not end-of-file, we're on the same file.
  137. ;
  138.     call    adjpnt    ;Else, this is the start of a new file...
  139.     call    filfpb    ;adjust pointers & fill new fpb
  140.     xra    a
  141.     lhld    sfext
  142.     mov    m,a    ;source file extent := 0
  143.     lhld    sfcr
  144.     mov    m,a    ;source file current record := 0
  145.     lhld    dfext
  146.     mov    m,a    ;dest file extent := 0
  147.     lhld    dfcr
  148.     mov    m,a    ;dest file current record := 0
  149.     lhld    eof
  150.     mov    m,a    ;eof := false
  151.     lhld    made
  152.     mov    m,a    ;made := false
  153.     lhld    opened
  154.     mov    m,a    ;opened := false
  155.     lhld    last
  156.     mov    m,a    ;last := false
  157.     mvi    a,true
  158.     sta    fpbusd    ;mark current fpb as used
  159.     lhld    sfcb
  160.     call    open
  161. ;
  162. samfil:    call    read
  163.     lhld    eof
  164.     mov    a,m
  165.     ana    a
  166.     jz    samnam    ;read sectors until eof or buffer full
  167. ;
  168. nxtnam:    call    ffname    ;on eof, find the next name to be considered
  169.     lxi    h,names
  170.     mov    a,m
  171.     sta    namcnt
  172. nnloop:    call    fnname    ;find next name...
  173.     lxi    h,namcnt
  174.     dcr    m
  175.     jnz    nnloop    ;as many times as necessary.
  176.     lxi    h,names
  177.     inr    m    ;then bump the count for the next pass
  178. ;
  179.     lda    fileof
  180.     ana    a    ;if all matching file names have been copied
  181.     jm    wr    ;(or passed over), start writing.
  182.     call    query    ;is the first file to be copied?
  183.     jnc    nxtnam    ;if not, try the next file
  184.     mvi    a,true
  185.     sta    one2go    ;if so, set 'one to go' to true, then copy it
  186.     lda    fpbusd
  187.     ana    a    ;if the current fpb is unused, use it
  188.     jz    samnam
  189.     lhld    rdma    ;else set up the next fpb, and use it
  190.     mov    a,m
  191.     inx    h
  192.     mov    h,m
  193.     mov    l,a
  194.     shld    fpbpnt    ;next block starts just past rdma
  195.     jmp    rdloop
  196. ;
  197. samnam:    lhld    rdma
  198.     call    bump    ;rdma := rdma + secsiz
  199.     jmp    rdloop
  200. ;
  201. wr:    lda    one2go    ;anything for the destination disk?
  202.     ana    a
  203.     jz    fini    ;if not, we're done.
  204.     lxi    h,buf
  205.     shld    fpbpnt    ;fpbpnt := buf
  206.     call    adjpnt
  207.     lxi    d,destmx
  208.     call    prompt    ;prompt(destmx)
  209. ;
  210. wrnext:    lhld    made
  211.     mov    a,m
  212.     ana    a
  213.     jnz    a$m    ;if already made, don't make it again
  214. ;
  215.     mvi    m,true    ;if not made, set made := true
  216.     lhld    opened
  217.     mvi    m,true    ;then set opened := true,
  218.     call    make    ;then make the file.
  219. ;
  220. a$m:    lhld    opened
  221.     mov    a,m
  222.     ana    a
  223.     jnz    a$op    ;if already opened, don't open it again
  224.     mvi    m,true
  225.     lhld    dfcb
  226.     call    open    ;if not open, open it & set opened := true
  227. ;
  228. a$op:    lhld    rdma
  229.     mov    e,m
  230.     inx    h
  231.     mov    d,m    ;de gets rdma
  232.     lhld    wdma
  233.     mov    a,e
  234.     cmp    m    ;compare least signifigant bytes
  235.     jnz    nequal
  236.     inx    h
  237.     mov    a,d
  238.     cmp    m
  239.     jz    equal    ;is wdma equal to rdma?
  240. ;
  241. nequal:    call    write    ;if not, write a sector
  242.     lhld    wdma
  243.     call    bump    ;wdma := wdma + secsiz
  244.     jmp    a$op
  245. ;
  246. equal:    call    close    ;when wdma = rdma, close the file
  247.     lhld    eof
  248.     mov    a,m
  249.     ana    a    ;done with file?
  250.     jz    skprpt    ;if not, don't report the transfer yet.
  251.     lda    rflag
  252.     ana    a    ;is the 'Report' option set?
  253.     jz    skprpt    ;if not, don't report the file transfer.
  254. ;
  255.     lxi    d,cpydmx
  256.     call    print    ;print 'Copied '
  257.     lhld    dfcb
  258.     call    pfname    ;print the file name
  259.     call    crlf    ;start a new line
  260. ;
  261. skprpt:    lhld    wdma
  262.     call    fulbuf    ;if the whole buffer has been written,
  263.     jc    wrexit    ;try to read another some more in
  264. ;
  265.     lhld    rdma    ;else, set up to write the next file
  266.     mov    e,m
  267.     inx    h
  268.     mov    d,m
  269.     xchg        ;hl points to next fpb
  270.     shld    fpbpnt    ;set up the file param. block pointer
  271.     lhld    last
  272.     mov    a,m
  273.     sta    done
  274.     ana    a
  275.     jnz    fini    ;if the last file has been written, we're done
  276.     call    adjpnt
  277.     jmp    wrnext    ;else adjust pointers, then write the next file
  278. ;
  279. wrexit:    lda    done
  280.     ana    a    ;shall we exit or read more files?
  281.     jnz    fini    ;we're done, so exit
  282. ;
  283.     lxi    b,freeo
  284.     lxi    d,buf
  285.     lhld    fpbpnt
  286.     call    ldir    ;move the last fpb to the start of the buffer
  287. ;
  288.     lxi    h,buf
  289.     shld    fpbpnt
  290.     call    adjpnt
  291.     call    filfpb    ;set up the pointers at the start of the buffer
  292. ;
  293.     lxi    d,sourmx
  294.     call    prompt    ;ask for the source disk
  295.     jmp    rdloop
  296. ;
  297. fini:    lxi    d,normal
  298. abort:    call    print
  299.     rst    boot
  300. ;
  301. namsiz    equ    12    ;size of a disk file name (1+8+3)
  302. fcbsiz    equ    36    ;size of a file control block
  303. sfcbo    equ    0    ;offset to source fcb
  304. sfexto    equ    12    ;offset to source file extent
  305. scro    equ    32    ;offset to source file current record
  306. dfcbo    equ    36    ;offset to destination file control block
  307. dfexto    equ    48    ;offset to destination file extent
  308. dcro    equ    68    ;offset to destination file current record
  309. rdmao    equ    72    ;offset to read zone pointer
  310. wdmao    equ    74    ;offset to write zone pointer
  311. madeo    equ    76    ;offset to file-made flag
  312. openo    equ    77    ;offset to file-open flag
  313. eofo    equ    78    ;offset to end-of-file flag
  314. lasto    equ    79    ;offset to last-file flag
  315. freeo    equ    80    ;offset to start of freespace
  316. ;
  317. adjpnt:    lhld    fpbpnt    ;compute and save the...
  318.     lxi    d,sfexto
  319.     dad    d
  320.     shld    sfext    ;    pointer to source file extent
  321.     lxi    d,scro-sfexto
  322.     dad    d
  323.     shld    sfcr    ;    pointer to source file current record,
  324.     lxi    d,dfcbo-scro
  325.     dad    d
  326.     shld    dfcb    ;    pointer to dest fcb,
  327.     lxi    d,dfexto-dfcbo
  328.     dad    d
  329.     shld    dfext    ;    pointer to dest file extent,
  330.     lxi    d,dcro-dfexto
  331.     dad    d
  332.     shld    dfcr    ;    pointer to dest file current record,
  333.     lxi    d,rdmao-dcro
  334.     dad    d
  335.     shld    rdma    ;    pointer to read dma zone,
  336.     inx    h
  337.     inx    h
  338.     shld    wdma    ;    pointer to write dma zone,
  339.     inx    h
  340.     inx    h
  341.     shld    made    ;    pointer to file made flag,
  342.     inx    h
  343.     shld    opened    ;    pointer to file-open flag
  344.     inx    h
  345.     shld    eof    ;    pointer to end-of-file flag,
  346.     inx    h
  347.     shld    last    ;    pointer to the 'last-file' flag,
  348.     inx    h
  349.     shld    fspace    ;and the pointer to the start of free space.
  350.     ret
  351. ;
  352. filfpb:    lhld    fpbpnt
  353.     xchg
  354.     lhld    fileof    ;get offset into directory bufffer
  355.     mvi    h,0
  356.     dad    h
  357.     dad    h
  358.     dad    h
  359.     dad    h
  360.     dad    h    ;multiply by 32
  361.     lxi    b,dirbuf
  362.     dad    b    ;hl points to file name
  363.     lxi    b,namsiz
  364.     push    h
  365.     push    b
  366.     call    ldir    ;move file name to source fcb
  367.     pop    b
  368.     lhld    dfcb
  369.     xchg
  370.     pop    h
  371.     call    ldir    ;move file name to destination fcb
  372.     lhld    fspace
  373.     xchg
  374.     lhld    rdma
  375.     mov    m,e
  376.     inx    h
  377.     mov    m,d    ;point rdma to start of free space
  378.     inx    h
  379.     mov    m,e
  380.     inx    h
  381.     mov    m,d    ;point wdma to start of free space
  382.     ret
  383. ;
  384. bump:    mvi    a,secsiz
  385.     add    m
  386.     mov    m,a    ;add sector size to l.s. byte of address
  387.     rnc
  388.     inx    h
  389.     inr    m    ;if carry, increment m.s. byte of address
  390.     ret
  391. ;
  392. fulbuf:    mov    e,m
  393.     inx    h
  394.     mov    d,m    ;de gets address to be compared
  395.     lhld    buftop
  396.     mov    a,l
  397.     sub    e
  398.     mov    a,h
  399.     sbb    d
  400.     ret        ;return with carry set if @(de) > buftop
  401. ;
  402. query:    lda    qflag
  403.     ana    a
  404.     stc
  405.     rz        ;copy all files if not querying
  406.     lxi    d,copymx
  407.     call    print    ;print 'Copy '
  408.     lda    fileof
  409.     ani    3
  410.     add    a
  411.     add    a
  412.     add    a
  413.     add    a
  414.     add    a    ;get 32 * file offset
  415.     lxi    h,dirbuf
  416.     add    l
  417.     mov    l,a
  418.     adc    h
  419.     sub    l
  420.     mov    h,a    ;point hl to filename
  421.     call    pfname    ;print the filename
  422.     lxi    d,qmark
  423.     call    print    ;print '?'
  424.  
  425. getit:    mvi    c,cstsf        ;check console for chr
  426.     call    bdos
  427.     ora    a
  428.     jz    getit        ;if none - loop until chr waiting
  429.     mvi    c,cif
  430.     call    bdos        ;get the chr
  431.     cpi    ' '        ;if a blank
  432.     jz    getit        ;loop and wait for next chr
  433.     ani    (not 20h) and 255
  434.     sui    'Y'        ;if y or Y
  435.     stc
  436.     rz            ;copy the file
  437.     cmc
  438.     ret
  439.  
  440. ;
  441. pfname:    mvi    a,8
  442.     call    pathl    ;print 8 characters in the name,
  443.     mvi    e,'.'
  444.     call    co    ;print a period,
  445.     mvi    a,3    ;print the 3 characters in the extension.
  446. ;
  447. pathl:    inx    h
  448.     mov    e,m
  449.     call    co    ;print the character @+(hl)
  450.     dcr    a
  451.     jnz    pathl    ;repeat (a) times
  452.     ret
  453. ;
  454. ;    system interface routines
  455. ;
  456. cif    equ       1    ;console input function #
  457. cof    equ       2
  458. printf    equ       9    ;print buffer function #
  459. linef    equ      10    ;line input function #
  460. cstsf    equ      11    ;get console status function #
  461. resetf    equ      13    ;select & write enable drive A
  462. seldsk    equ       14    ;select disk drive
  463. openf    equ      15    ;open file function #
  464. closef    equ      16    ;close file function #
  465. sfff    equ      17    ;search for first function #
  466. sfnf    equ      18    ;search for next function #
  467. deletef    equ      19    ;delete file function #
  468. readf    equ      20    ;sequential file read
  469. writef    equ      21    ;sequential file write
  470. makef    equ      22    ;create & open a new file
  471. isdrv    equ      25    ;interogate selected drive
  472. dmaf    equ      26    ;set dma address function #
  473. ;
  474. open:    mvi    c,openf
  475.     xchg
  476.     call    bdos
  477.     inr    a
  478.     jz    openng
  479.     ret
  480. openng:    lxi    d,cantop
  481.     jmp    abort
  482. ;
  483. close:    mvi    c,closef
  484.     lhld    dfcb
  485.     xchg
  486.     call    bdos
  487.     lhld    opened
  488.     mvi    m,false
  489.     ret
  490. ;
  491. read:    lhld    rdma
  492.     mov    e,m
  493.     inx    h
  494.     mov    d,m
  495.     call    setdma
  496.     mvi    c,readf
  497.     lhld    fpbpnt
  498.     xchg
  499.     call    bdos
  500.     lhld    eof
  501.     mov    m,a
  502.     ana    a
  503.     rnz
  504.     ret
  505. ;
  506. write:    lhld    wdma
  507.     mov    e,m
  508.     inx    h
  509.     mov    d,m
  510.     call    setdma
  511.     mvi    c,writef
  512.     lhld    dfcb
  513.     xchg
  514.     call    bdos
  515.     ana    a
  516.     jnz    cantwr
  517.     ret
  518. cantwr:    lxi    d,space
  519.     jmp    abort
  520. ;
  521. make:    mvi    c,deletef
  522.     lhld    dfcb
  523.     xchg
  524.     call    bdos
  525.     mvi    c,makef
  526.     lhld    dfcb
  527.     xchg
  528.     call    bdos
  529.     inr    a
  530.     jz    makeng
  531.     ret
  532. makeng:    lxi    d,wrprot
  533.     call    print
  534.     lxi    d,nodir
  535.     jmp    abort
  536. ;
  537. setdma:    mvi    c,dmaf
  538.     jmp    bdos
  539. ;
  540. reset:    mvi    c,resetf
  541.     call    bdos
  542. ;    april 1982 - select desired disk drive
  543.     mvi    c,seldsk
  544.     lda    drive
  545.     mov    e,a
  546.     jmp    bdos
  547. ;
  548. ;
  549. crlf:    mvi    e,cr
  550.     call    co
  551.     mvi    e,lf
  552. co:    push    h
  553.     push    psw
  554.     mvi    c,cof
  555.     call    bdos
  556.     pop    psw
  557.     pop    h
  558.     ret
  559. ;
  560. print:    mvi    c,printf
  561.     jmp    bdos
  562. ;
  563. ffname:    lxi    d,dirbuf
  564.     call    setdma
  565.     mvi    c,sfff
  566.     lxi    d,fcb1
  567.     call    bdos
  568.     sta    fileof
  569.     inr    a
  570.     jnz    fixf
  571.     lxi    d,nofile
  572.     jmp    abort
  573. ;
  574. fnname:    lxi    d,dirbuf
  575.     call    setdma
  576.     mvi    c,sfnf
  577.     lxi    d,fcb1
  578.     call    bdos
  579.     sta    fileof
  580.     add    a
  581.     sbb    a    ;a:=255 if fileof=255, else 0
  582.     lhld    last
  583.     mov    m,a
  584. ;
  585. ;    april 1982 fix for cpm1.4 where numbers >3 were detected
  586. ;    but not desired...hence and with 3
  587. ;
  588. fixf:    lda    fileof
  589.     cpi    255
  590.     rz
  591.     ani    3
  592.     sta    fileof
  593.     ret
  594. ;
  595. prompt:    
  596.     call    print
  597. clear:    mvi    c,cstsf
  598.     call    bdos
  599.     ana    a
  600.     jz    wait
  601.     mvi    c,cif
  602.     call    bdos    ;if there's a char waiting, get it & ignore it.
  603.     jmp    clear
  604. wait:    mvi    c,cif
  605.     call    bdos    ;get the next char
  606.     cpi    cntrlc
  607.     jz    boot
  608.     cpi    cr
  609.     jnz    badch    ;explain the procedure
  610.     call    reset
  611.     ret
  612. ;
  613. badch:    lxi    d,explan
  614.     jmp    prompt
  615. ;
  616. ldir:    mov    a,m
  617.     stax    d
  618.     inx    h
  619.     inx    d
  620.     dcx    b
  621.     mov    a,c
  622.     ora    b
  623.     jnz    ldir
  624.     ret
  625. ;
  626. ;    console messages
  627. ;
  628. ;
  629. banner:    db    esc,clrscr
  630.     db    cr,lf
  631.     db    ' PX-8 SWAPCOPY v2.3PX   SINGLE DRIVE FILE COPYING PROGRAM '
  632.     db    cr,lf,lf
  633.     db    '                by Steve Sanders 06-Jan-85'
  634.     db    cr,lf
  635.     db    '        PX-8 installation by Ted Nevels 04-Dec-86'          
  636.     db    cr,lf,lf,'$'
  637. sourmx:    db    cr,lf,' ==> Insert SOURCE disk, press <RETURN>: '
  638.     db    bell,'$'
  639. destmx:    db    cr,lf,' ==> Insert DESTINATION disk, press <RETURN>: '
  640.     db    bell, '$'
  641. copymx:    db    cr,lf,' Copy --> $'
  642. cpydmx:    db    bell,cr,lf,' Copied --> $'
  643. qmark:    db    '  (y/n)? ',bell,'$'
  644. explan:    db    cr,lf
  645.     db    ' To continue press <RETURN> '
  646.     db    cr,lf
  647.     db    '    or CTRL-C to abort'
  648.     db    cr,lf
  649.     db    '$'
  650. normal:    db    cr,lf,lf
  651.     db    '  *== PX-8 SwapCopy is finished ==*',cr,lf,bell,'$'
  652. nospec:    db    bell
  653.     db    cr,lf,' *--> No file specification was entered - ABORTING.'
  654.     db    cr,lf,lf,'      Use *.* for all or specify filename desired.'
  655.     db    cr,lf,lf
  656.     db    '      Note: Currently logged drive will be used for copying.'
  657.     db    cr,lf,bell,'$'
  658. nofile:    db    cr,lf,' *--> No source files',bell, cr, lf, '$'
  659. nodir:    db    cr,lf,' *--> Directory is full',bell, cr, lf, '$'
  660. cantop:    db    cr,lf,' *--> Cannot reopen file.',bell, cr, lf, '$'
  661. space:    db    cr,lf,' *--> Disk is full.',bell, cr, lf, '$'
  662. wrprot:    db    cr,lf,' *--> Disk is write protected.', bell,cr, lf, '$'
  663. ;
  664. ;    data areas
  665. ;
  666. sfcb:    ds    0
  667. fpbpnt:    ds    2    ;pointer to start of the file param. block
  668. sfext:    ds    2    ;pointer to source file extent byte
  669. sfcr:    ds    2    ;pointer to source file current record byte
  670. dfcb:    ds    2    ;pointer to destination file control block
  671. dfext:    ds    2    ;pointer to dest file extent byte
  672. dfcr:    ds    2    ;pointer to dest file current record byte
  673. buftop:    ds    2    ;pointer to top of free memory
  674. rdma:    ds    2    ;pointer to next read dma zone
  675. wdma:    ds    2    ;pointer to next write dma zone
  676. made:    ds    2    ;pointer to file made flag
  677. opened:    ds    2    ;pointer to file open flag
  678. eof:    ds    2    ;pointer to end of file flag
  679. last:    ds    2    ;pointer to last file flag
  680. fspace:    ds    2    ;pointer to start of free buffer space
  681. fileof:    ds    1    ;file offset. index into dirbuf
  682. done:    ds    1    ;all files copied flag
  683. names:    ds    1    ;number of the next file to be copied
  684. namcnt:    ds    1    ;copy of 'names'. used as a counter
  685. drive    ds    1    ;drive number 0-3 for a-d and so on
  686. qflag:    ds    1    ;'Query' option flag
  687. rflag:    ds    1    ;'Report' option flag
  688. fpbusd:    ds    1    ;current fpb has been used flag
  689. one2go:    ds    1    ;there is a file to be transfered flag
  690. ;
  691.     ds     64    ;32 level stack
  692. stack:    ds      0
  693. ;
  694. dirbuf:    ds    secsiz    ;buffer for searching the directory
  695. ;
  696. buf:    ds      0    ;buffer starts here and extends to fbase
  697. ;
  698.     end    swapcopy
  699.