2016-11-01 21:37:12 +00:00
|
|
|
|
NEW
|
2019-09-19 15:22:14 +00:00
|
|
|
|
AUTO 3,1
|
2016-11-01 21:37:12 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
X.RESETSRCDIR .EQ 0 single pass
|
2017-02-21 17:01:30 +00:00
|
|
|
|
*--------------------------------------
|
2019-10-12 14:20:09 +00:00
|
|
|
|
.DUMMY
|
|
|
|
|
.OR ZPBIN
|
|
|
|
|
ZS.START
|
|
|
|
|
ZPPtr1 .BS 2
|
|
|
|
|
ZPPtr2 .BS 2
|
|
|
|
|
ZPFileName .BS 2
|
|
|
|
|
ZPFileStat .BS 2
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
|
|
|
|
bContinue .BS 1
|
|
|
|
|
bRecurse .BS 1
|
|
|
|
|
bQuiet .BS 1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bPause .BS 1
|
|
|
|
|
|
|
|
|
|
Count .BS 2
|
|
|
|
|
|
|
|
|
|
PageCount .EQ *
|
|
|
|
|
ArgIndex .BS 1
|
|
|
|
|
|
|
|
|
|
hSrcFullPath .BS 1
|
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
X.COPY.MINBUF .EQ 1024
|
|
|
|
|
X.COPY.MAXBUF .EQ 4096
|
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
bNoConfirm .BS 1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
hDstFullPath .BS 1
|
|
|
|
|
|
|
|
|
|
hSrcFile .BS 1
|
|
|
|
|
hDstFile .BS 1
|
|
|
|
|
hCopyBuf .BS 1
|
2021-06-26 20:24:25 +00:00
|
|
|
|
.FIN
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
2019-10-12 14:20:09 +00:00
|
|
|
|
ZS.END .ED
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
2017-10-03 15:33:30 +00:00
|
|
|
|
.DA CS.END-CS.START CS
|
|
|
|
|
.DA DS.END-DS.START DS
|
2018-08-11 10:57:57 +00:00
|
|
|
|
.DA #64 SS
|
2019-10-12 14:20:09 +00:00
|
|
|
|
.DA #ZS.END-ZS.START Zero Page Size
|
2016-11-01 21:37:12 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
2019-10-03 06:25:27 +00:00
|
|
|
|
*--------------------------------------
|
2016-11-01 21:37:12 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
2021-06-27 13:48:04 +00:00
|
|
|
|
.DA CS.DOEVENT
|
2016-11-01 21:37:12 +00:00
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.MSG.USAGE .DA MSG.USAGE
|
|
|
|
|
L.MSG.DIR .DA MSG.DIR
|
2020-02-29 14:06:28 +00:00
|
|
|
|
L.MSG.REG .DA MSG.REG
|
2017-02-24 16:34:02 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2017-06-27 20:37:45 +00:00
|
|
|
|
L.MSG.OVERWRITE .DA MSG.OVERWRITE
|
2017-02-24 16:34:02 +00:00
|
|
|
|
.FIN
|
2016-11-01 21:37:12 +00:00
|
|
|
|
L.MSG.OK .DA MSG.OK
|
|
|
|
|
L.MSG.ERR .DA MSG.ERR
|
2019-10-28 06:32:12 +00:00
|
|
|
|
L.MSG.CRLF .DA MSG.CRLF
|
2017-06-21 15:46:43 +00:00
|
|
|
|
L.MSG.DONE .DA MSG.DONE
|
2016-11-01 21:37:12 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.INIT clc
|
|
|
|
|
CS.INIT.RTS rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN jsr CS.RUN.CheckOpt
|
|
|
|
|
bcs CS.INIT.RTS
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
>LDYAI 256
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL GetMem
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bcs CS.INIT.RTS
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
stx hSrcFullPath
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2017-06-27 16:00:32 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2017-06-28 14:34:11 +00:00
|
|
|
|
>LDYAI 256
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL GetMem
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bcs CS.INIT.RTS
|
2017-10-04 15:12:03 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
stx hDstFullPath
|
2017-06-27 16:00:32 +00:00
|
|
|
|
.FIN
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.Loop jsr CS.RUN.CheckKey
|
|
|
|
|
bcs .99
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bit bPause
|
|
|
|
|
bmi CS.RUN.Loop
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
jsr X.GetEntry
|
|
|
|
|
bcs .80
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
jsr X.IncludeMatch
|
|
|
|
|
bcs .8 no match, skip....
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
jsr X.IgnoreMatch
|
|
|
|
|
bcc .8
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
jsr CS.RUN.BuildFilePath
|
2017-06-28 15:34:36 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
ldy #S.STAT.MODE+1
|
|
|
|
|
lda (ZPFileStat),y
|
|
|
|
|
and #$70
|
|
|
|
|
bne .1 REG file ?
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
jsr CS.RUN.REG
|
|
|
|
|
bra .7
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.1 cmp /S.STAT.MODE.DIR DIR ?
|
|
|
|
|
bne .98
|
2017-06-28 14:34:11 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bit bRecurse
|
|
|
|
|
bpl .8
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda (ZPFileName)
|
|
|
|
|
cmp #'.'
|
|
|
|
|
bne .2 Skip "." & ".."
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPFileName),y
|
|
|
|
|
beq .8
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
cmp #'.'
|
|
|
|
|
bne .2 Skip "." & ".."
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (ZPFileName),y
|
|
|
|
|
beq .8
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.2 jsr CS.RUN.DIR
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.7 jsr CS.RUN.CheckErr
|
|
|
|
|
bcs .99
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.8 jsr X.GetNextEntry
|
|
|
|
|
bcc CS.RUN.Loop
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.80 jsr CS.RUN.LEAVE
|
|
|
|
|
bcc .8
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
rts
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.98 lda #MLI.E.UNSUPST
|
2017-02-24 07:46:53 +00:00
|
|
|
|
sec
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.99 rts
|
2017-02-26 18:34:00 +00:00
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.LEAVE jsr X.LeaveSubDir exit this sub dir....
|
|
|
|
|
bcs .90 base, we are done, exit
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
jsr X.BasePath..
|
2016-11-13 21:03:31 +00:00
|
|
|
|
.DO X.DELETE.SOURCE=1
|
2017-02-24 07:46:53 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
jsr X.GetEntry
|
2017-06-28 14:34:11 +00:00
|
|
|
|
jsr CS.RUN.BuildFilePath
|
2017-06-30 15:11:29 +00:00
|
|
|
|
jsr CS.RUN.DIR.MSG
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bcs .99
|
2017-02-24 07:46:53 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hSrcFullPath
|
|
|
|
|
jsr CS.RUN.GetPathA
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL Remove
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.ELSE
|
|
|
|
|
clc
|
2017-02-24 07:46:53 +00:00
|
|
|
|
.FIN
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
rts
|
2017-02-26 18:34:00 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.90 bit bQuiet
|
|
|
|
|
bmi .98
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHW L.MSG.DONE
|
2023-02-07 07:04:23 +00:00
|
|
|
|
>PUSHW Count
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 2
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bcs .99
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.98 lda #0
|
2016-11-01 21:37:12 +00:00
|
|
|
|
sec
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.99 rts
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.DIR jsr CS.RUN.DIR.MSG
|
|
|
|
|
bcs .99
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
jsr CS.RUN.CheckOverwrite
|
|
|
|
|
bcs .99 ABORT
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bmi .99 NO
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bne .8 YES, no create but enter
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hDstFullPath NOT EXISTS
|
|
|
|
|
jsr CS.RUN.PushPathA
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2020-02-29 14:06:28 +00:00
|
|
|
|
ldy #S.STAT.MODE+1
|
|
|
|
|
lda (ZPFileStat),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPFileStat),y
|
|
|
|
|
>PUSHA
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL MKDir
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bcs .99
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2019-04-29 15:47:17 +00:00
|
|
|
|
jsr CS.RUN.IncCount
|
2017-02-21 17:01:30 +00:00
|
|
|
|
.FIN
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.8 >LDYA ZPFileName
|
|
|
|
|
jmp X.EnterSubDirYA
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.99 rts
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
2021-06-26 20:24:25 +00:00
|
|
|
|
CS.RUN.REG ldx #2
|
|
|
|
|
jsr CS.RUN.REG.MSG
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bcs .99
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2017-06-30 15:11:29 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
jsr CS.RUN.CheckOverwrite
|
|
|
|
|
bcs .99 ABORT
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bmi .99 do not overwrite
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
.2 .DO X.DELETE.SOURCE=1 mv file, check if srcbase=dstbase
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bne .3 overwrite, copy over
|
|
|
|
|
|
|
|
|
|
lda hSrcBasePath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
|
|
|
|
lda hDstBasePath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
2018-12-17 15:21:32 +00:00
|
|
|
|
>SYSCALL StrCaseCmp
|
2017-06-21 15:46:43 +00:00
|
|
|
|
bcs .3 not same dir, go copy/delete
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hSrcFullPath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
|
|
|
|
lda hDstFullPath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
|
|
|
|
>SYSCALL Rename
|
|
|
|
|
bcc .8
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
rts
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2017-06-21 15:46:43 +00:00
|
|
|
|
.FIN
|
|
|
|
|
.3 jsr CS.RUN.CopyStart
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bcs .99
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.FIN
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
|
|
|
|
.4 .DO X.DELETE.SOURCE=1
|
2017-06-26 15:28:18 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hSrcFullPath
|
|
|
|
|
jsr CS.RUN.GetPathA
|
|
|
|
|
>SYSCALL Remove
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.FIN
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.8 jmp CS.RUN.IncCount
|
2017-02-24 16:34:02 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.99 rts
|
2017-06-23 12:04:39 +00:00
|
|
|
|
*--------------------------------------
|
2021-06-26 20:24:25 +00:00
|
|
|
|
CS.RUN.DIR.MSG ldx #0
|
2017-06-30 15:11:29 +00:00
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
CS.RUN.REG.MSG bit bQuiet
|
2017-06-30 15:11:29 +00:00
|
|
|
|
bmi .8
|
2020-02-14 07:21:56 +00:00
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
>PUSHW L.MSG.DIR,x
|
2020-02-14 07:21:56 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hSrcFullPath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
2017-06-30 15:11:29 +00:00
|
|
|
|
|
2018-08-23 15:16:20 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hDstFullPath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 4
|
2020-02-14 07:21:56 +00:00
|
|
|
|
|
2018-08-23 15:16:20 +00:00
|
|
|
|
.ELSE
|
|
|
|
|
>PUSHBI 2
|
|
|
|
|
|
|
|
|
|
.FIN
|
2020-02-14 07:21:56 +00:00
|
|
|
|
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2017-06-30 15:11:29 +00:00
|
|
|
|
rts
|
2020-02-14 07:21:56 +00:00
|
|
|
|
|
2017-06-30 15:11:29 +00:00
|
|
|
|
.8 clc
|
2017-06-27 20:37:45 +00:00
|
|
|
|
rts
|
2017-07-01 13:45:53 +00:00
|
|
|
|
*--------------------------------------
|
2020-02-14 07:21:56 +00:00
|
|
|
|
CS.RUN.CR >PUSHW L.MSG.CRLF
|
|
|
|
|
>PUSHBI 0
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.CR.RTS rts
|
2017-06-21 15:46:43 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.CopyStart
|
|
|
|
|
stz hSrcFile
|
|
|
|
|
stz hDstFile
|
|
|
|
|
stz hCopyBuf
|
|
|
|
|
|
|
|
|
|
lda hSrcFullPath
|
|
|
|
|
ldx #O.RDONLY
|
|
|
|
|
jsr CS.RUN.Open
|
2018-11-12 21:34:55 +00:00
|
|
|
|
bcs .9
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
sta hSrcFile
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hDstFullPath
|
|
|
|
|
ldx #O.WRONLY+O.CREATE
|
|
|
|
|
jsr CS.RUN.Open
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
bcs .9
|
2020-05-21 12:55:49 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
sta hDstFile
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda /X.COPY.MAXBUF
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.1 sta PageCount
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
ldy #0
|
|
|
|
|
>SYSCALL GetMem
|
|
|
|
|
bcc .2
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
tax
|
2017-02-20 17:16:23 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda PageCount
|
|
|
|
|
lsr
|
|
|
|
|
cmp /X.COPY.MINBUF
|
|
|
|
|
bcs .1
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
txa
|
|
|
|
|
sec
|
|
|
|
|
.9 bra CS.RUN.CopyEnd
|
|
|
|
|
|
|
|
|
|
.2 >STYA ZPPtr1
|
|
|
|
|
stx hCopyBuf
|
2017-02-21 17:01:30 +00:00
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.Copy >PUSHB hSrcFile
|
2018-07-25 15:26:14 +00:00
|
|
|
|
>PUSHW ZPPtr1 Dst Ptr
|
2023-02-07 07:04:23 +00:00
|
|
|
|
>PUSHB PageCount Bytes To Read
|
|
|
|
|
>PUSHBI 0
|
2017-02-21 17:01:30 +00:00
|
|
|
|
>SYSCALL FRead
|
|
|
|
|
bcc .1
|
2020-05-19 13:00:17 +00:00
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
cmp #MLI.E.EOF
|
2023-02-07 07:04:23 +00:00
|
|
|
|
sec
|
|
|
|
|
bne CS.RUN.CopyEnd
|
2020-05-19 13:00:17 +00:00
|
|
|
|
|
2017-02-22 07:31:16 +00:00
|
|
|
|
lda #0
|
2020-05-21 12:55:49 +00:00
|
|
|
|
clc
|
2021-07-10 19:09:43 +00:00
|
|
|
|
bra CS.RUN.CopyEnd
|
2020-05-19 13:00:17 +00:00
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
.1 sta ZPPtr2+1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
>PUSHB hDstFile
|
2018-07-25 15:26:14 +00:00
|
|
|
|
>PUSHW ZPPtr1 Src Ptr
|
2023-02-10 18:19:29 +00:00
|
|
|
|
lda ZPPtr2+1
|
2021-05-14 20:58:20 +00:00
|
|
|
|
>PUSHYA Bytes To Write
|
2017-02-21 17:01:30 +00:00
|
|
|
|
>SYSCALL FWrite
|
2021-07-10 19:09:43 +00:00
|
|
|
|
bcs CS.RUN.CopyEnd
|
2020-05-19 13:00:17 +00:00
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
bit bQuiet
|
2023-02-10 18:19:29 +00:00
|
|
|
|
bmi .2
|
2017-06-23 12:04:39 +00:00
|
|
|
|
|
2017-02-21 17:01:30 +00:00
|
|
|
|
lda #'.'
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL PutChar
|
2017-04-03 15:35:03 +00:00
|
|
|
|
|
2023-02-10 18:19:29 +00:00
|
|
|
|
.2 jsr CS.RUN.CheckKey
|
|
|
|
|
bcs CS.RUN.CopyEnd
|
|
|
|
|
|
|
|
|
|
lda ZPPtr2+1
|
|
|
|
|
cmp PageCount
|
|
|
|
|
bcs CS.RUN.Copy
|
|
|
|
|
|
|
|
|
|
* clc
|
2017-02-21 17:01:30 +00:00
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.CopyEnd php
|
2021-07-10 19:09:43 +00:00
|
|
|
|
pha
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
lda hDstFile
|
2020-05-21 12:55:49 +00:00
|
|
|
|
beq .1
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL FClose
|
2017-06-28 14:34:11 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.1 lda hSrcFile
|
2020-05-21 12:55:49 +00:00
|
|
|
|
beq .2
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL FClose
|
2017-02-22 16:32:02 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.2 lda hCopyBuf
|
2020-05-21 12:55:49 +00:00
|
|
|
|
beq .3
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2020-05-21 12:55:49 +00:00
|
|
|
|
>SYSCALL FreeMem
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.3 pla
|
2020-05-19 13:00:17 +00:00
|
|
|
|
plp
|
2021-07-10 19:09:43 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.Copy.RTS rts
|
2017-02-22 16:32:02 +00:00
|
|
|
|
.FIN
|
2017-02-21 17:01:30 +00:00
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.Open phx Save open mode
|
|
|
|
|
jsr CS.RUN.PushPathA
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2020-05-21 12:55:49 +00:00
|
|
|
|
pla
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
|
|
|
|
ldy #S.STAT.P.TYPE
|
|
|
|
|
>PUSHB (ZPFileStat),y
|
|
|
|
|
|
|
|
|
|
ldy #S.STAT.P.AUXTYPE+1
|
|
|
|
|
>PUSHB (ZPFileStat),y
|
|
|
|
|
dey
|
2021-06-27 13:48:04 +00:00
|
|
|
|
>PUSHB (ZPFileStat),y
|
2020-05-21 12:55:49 +00:00
|
|
|
|
|
|
|
|
|
>SYSCALL FOpen
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-02-22 16:32:02 +00:00
|
|
|
|
CS.RUN.CheckErr bcs .1
|
2019-10-28 06:32:12 +00:00
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
bit bQuiet
|
2017-06-23 12:04:39 +00:00
|
|
|
|
bmi .8
|
2019-10-28 06:32:12 +00:00
|
|
|
|
|
2017-06-23 12:04:39 +00:00
|
|
|
|
>LDYA L.MSG.OK
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PutS
|
2018-09-05 11:31:49 +00:00
|
|
|
|
.8 rts
|
2019-10-28 06:32:12 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.1 tax
|
|
|
|
|
clc
|
|
|
|
|
beq .8 SKIP
|
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHW L.MSG.ERR
|
2023-02-07 07:04:23 +00:00
|
|
|
|
txa
|
2020-02-14 07:21:56 +00:00
|
|
|
|
pha
|
2017-02-22 16:32:02 +00:00
|
|
|
|
>PUSHA
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHBI 1
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2019-10-28 06:32:12 +00:00
|
|
|
|
|
2017-02-23 16:43:42 +00:00
|
|
|
|
pla
|
2023-02-07 07:04:23 +00:00
|
|
|
|
sec
|
|
|
|
|
bit bContinue
|
|
|
|
|
bpl .99
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
|
|
|
|
|
.99 rts
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
2017-06-27 16:00:32 +00:00
|
|
|
|
CS.RUN.BuildFilePath
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hSrcFullPath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
|
|
|
|
>LDA.G hSrcBasePath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
2017-10-03 15:33:30 +00:00
|
|
|
|
>SYSCALL StrCpy
|
2017-06-27 16:00:32 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hSrcFullPath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
2017-06-26 15:28:18 +00:00
|
|
|
|
>PUSHW ZPFileName
|
2017-10-03 15:33:30 +00:00
|
|
|
|
>SYSCALL StrCat
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2017-06-27 16:00:32 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hDstFullPath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
|
|
|
|
>LDA.G hDstBasePath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
2017-10-03 15:33:30 +00:00
|
|
|
|
>SYSCALL StrCpy
|
2017-06-27 16:00:32 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hDstFullPath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
>LDA.G hDstFileName
|
2017-06-27 16:00:32 +00:00
|
|
|
|
beq .1
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2021-06-27 13:48:04 +00:00
|
|
|
|
>SYSCALL GetMemPtr
|
2017-06-26 15:28:18 +00:00
|
|
|
|
>PUSHYA
|
2017-06-27 16:00:32 +00:00
|
|
|
|
bra .2
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2017-06-27 16:00:32 +00:00
|
|
|
|
.1 >PUSHW ZPFileName
|
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
.2 >SYSCALL StrCat
|
2017-06-27 16:00:32 +00:00
|
|
|
|
.FIN
|
2016-11-13 21:03:31 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.GetPathA sec
|
2021-06-26 20:24:25 +00:00
|
|
|
|
.HS 90 BCC
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.PushPathA
|
2021-06-26 20:24:25 +00:00
|
|
|
|
clc
|
|
|
|
|
php
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
|
|
|
|
|
plp
|
|
|
|
|
bcs .8
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
>PUSHYA
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
.8 rts
|
2017-06-30 15:11:29 +00:00
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.IncCount inc Count
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
inc Count+1
|
|
|
|
|
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DO X.COPY.TO.DEST=1
|
|
|
|
|
CS.RUN.CheckOverwrite
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
lda hDstFullPath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
|
|
|
|
>PUSHEA.G STATBUF
|
|
|
|
|
>SYSCALL Stat
|
|
|
|
|
bcs .8 File Not exists...
|
|
|
|
|
|
|
|
|
|
bit bNoConfirm
|
|
|
|
|
bmi .4 no prompt, override
|
|
|
|
|
|
|
|
|
|
bit bQuiet
|
|
|
|
|
bmi .10
|
|
|
|
|
|
|
|
|
|
jsr CS.RUN.CR
|
|
|
|
|
|
|
|
|
|
.10 >PUSHW L.MSG.OVERWRITE
|
|
|
|
|
lda hDstFullPath
|
|
|
|
|
jsr CS.RUN.PushPathA
|
|
|
|
|
>PUSHBI 2
|
|
|
|
|
>SYSCALL PrintF
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
.1 >SYSCALL GetChar
|
|
|
|
|
|
|
|
|
|
cmp #3
|
|
|
|
|
beq .99 abort
|
|
|
|
|
|
|
|
|
|
jsr X.ToUpper
|
|
|
|
|
|
|
|
|
|
cmp #'N'
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
lda #$80 EXISTS, NO OVERWRITE
|
|
|
|
|
clc
|
2018-11-12 21:34:55 +00:00
|
|
|
|
rts
|
2023-02-07 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
.2 cmp #'Y'
|
|
|
|
|
beq .4
|
|
|
|
|
|
|
|
|
|
.3 cmp #'A'
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
* sec
|
|
|
|
|
ror bNoConfirm
|
|
|
|
|
|
|
|
|
|
.4 lda #$01 EXISTS, OVERWRITE
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.8 lda #0 NOT EXISTS
|
|
|
|
|
clc
|
|
|
|
|
.99 rts
|
|
|
|
|
.FIN
|
2017-06-28 14:34:11 +00:00
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.RUN.CheckKey ldy #S.PS.hStdIn
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL FEOF
|
|
|
|
|
bcs .9 I/O error
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
tay
|
|
|
|
|
bne .8
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
>SYSCALL GetChar
|
|
|
|
|
bcs .9 I/O error
|
2021-06-26 20:24:25 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
cmp #$03 Ctrl-C
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
cmp #$13 Ctrl-S
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
lda bPause
|
|
|
|
|
eor #$ff
|
|
|
|
|
sta bPause
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.CheckOpt jsr CS.RUN.NextOpt
|
|
|
|
|
bcs .7
|
|
|
|
|
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
cmp #'-'
|
|
|
|
|
bne .5
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
beq .98
|
|
|
|
|
|
|
|
|
|
.1 ldx #OptionVars-OptionList-1
|
|
|
|
|
|
|
|
|
|
.2 cmp OptionList,x
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
.98 >LDYA L.MSG.USAGE
|
|
|
|
|
>SYSCALL PutS
|
|
|
|
|
lda #E.SYN
|
|
|
|
|
sec
|
|
|
|
|
.99 rts
|
|
|
|
|
|
|
|
|
|
.3 lda OptionVars,x
|
|
|
|
|
beq .4 -I
|
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
dec 0,x
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
bra CS.RUN.CheckOpt
|
|
|
|
|
|
|
|
|
|
.4 iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
bne .98
|
|
|
|
|
|
|
|
|
|
>LDA.G hExclude
|
|
|
|
|
bne .98
|
|
|
|
|
|
|
|
|
|
jsr CS.RUN.NextOpt
|
|
|
|
|
bcs .98
|
|
|
|
|
|
|
|
|
|
>SYSCALL StrDup
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
>STA.G hExclude
|
|
|
|
|
bra CS.RUN.CheckOpt
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.5 >LDA.G index
|
|
|
|
|
|
|
|
|
|
.DO X.COPY.TO.DEST=1
|
|
|
|
|
bne .6 Already have a Src dir...
|
|
|
|
|
.ELSE
|
|
|
|
|
bne .98
|
|
|
|
|
.FIN
|
|
|
|
|
|
|
|
|
|
jsr X.InitSrcDirPtr1
|
|
|
|
|
bcc CS.RUN.CheckOpt success, scan for any other args
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.DO X.COPY.TO.DEST=1
|
|
|
|
|
.6 >LDA.G hDstBasePath
|
|
|
|
|
bne .98 we already have a second arg....error!
|
|
|
|
|
|
|
|
|
|
jsr X.InitDstDirPtr1
|
|
|
|
|
bcc CS.RUN.CheckOpt success, scan for any other args
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
.FIN
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.7 >LDA.G index processed all args
|
|
|
|
|
beq .98 , no src ? ERROR
|
|
|
|
|
|
|
|
|
|
.DO X.COPY.TO.DEST=1
|
|
|
|
|
>LDA.G hDstBasePath
|
|
|
|
|
bne .8 we also have a Dst folder
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hCWD no dst folder, use actual prefix
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
jsr X.InitDstDirYA
|
|
|
|
|
bcs .99
|
|
|
|
|
.FIN
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.NextOpt inc ArgIndex
|
|
|
|
|
lda ArgIndex
|
|
|
|
|
>SYSCALL ArgV
|
|
|
|
|
rts
|
2019-10-11 13:06:33 +00:00
|
|
|
|
*--------------------------------------
|
2017-02-20 17:16:23 +00:00
|
|
|
|
CS.DOEVENT sec
|
2016-11-01 21:37:12 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2023-02-07 07:04:23 +00:00
|
|
|
|
CS.QUIT jsr X.LeaveSubDir
|
2016-11-01 21:37:12 +00:00
|
|
|
|
bcc CS.QUIT
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2017-06-27 20:37:45 +00:00
|
|
|
|
.DO X.COPY.TO.DEST=1
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hDstFullPath
|
|
|
|
|
jsr .8
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2020-03-03 16:44:52 +00:00
|
|
|
|
ldy #hDstFileName
|
2019-06-02 08:58:46 +00:00
|
|
|
|
jsr .7
|
2017-06-27 20:37:45 +00:00
|
|
|
|
.FIN
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
lda hSrcFullPath
|
|
|
|
|
jsr .8
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2023-02-07 07:04:23 +00:00
|
|
|
|
ldy #hInclude
|
2021-06-26 20:24:25 +00:00
|
|
|
|
jsr .7
|
2021-06-27 13:48:04 +00:00
|
|
|
|
|
2021-06-26 20:24:25 +00:00
|
|
|
|
ldy #hExclude
|
2019-06-02 08:58:46 +00:00
|
|
|
|
|
|
|
|
|
.7 lda (pData),y
|
2023-02-07 07:04:23 +00:00
|
|
|
|
.8 beq .9
|
2019-10-12 14:20:09 +00:00
|
|
|
|
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL FreeMem
|
2019-06-04 15:49:58 +00:00
|
|
|
|
.9 clc
|
|
|
|
|
rts
|
2017-06-27 16:00:32 +00:00
|
|
|
|
*--------------------------------------
|
2016-11-01 21:37:12 +00:00
|
|
|
|
MAN
|
2020-10-06 06:27:35 +00:00
|
|
|
|
SAVE usr/src/shared/x.cpmvrm.s
|
2020-05-21 12:55:49 +00:00
|
|
|
|
LOAD usr/src/bin/cp.s
|
2018-08-11 10:57:57 +00:00
|
|
|
|
ASM
|