Kernel version 0.9 : CP,RM,MV, Code rewrite in progress....

This commit is contained in:
Rémy GIBERT 2017-06-27 18:00:32 +02:00
parent e5386f3e27
commit 503314812d
6 changed files with 139 additions and 112 deletions

Binary file not shown.

Binary file not shown.

View File

@ -24,9 +24,9 @@ OptionList >PSTR "CRYQcryq"
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm,#bQuiet,#bContinue,#bRecurse,#bNoConfirm,#bQuiet
*--------------------------------------
MSG.USAGE >CSTR "Usage : CP [Src File/Dir, *,? wildcards allowed]\r\n -C : Continue on error\r\n -Q : Quiet\r\n -R : Recurse subdirectories\r\n -Y : Dont't prompt for override\r\n"
MSG.DIR >CSTR "CP Dir :%S%S to %S%S..."
MSG.FILE >CSTR "CP File:%S%S to %S%S..."
MSG.OVERWRTE >CSTR "Overwrite [Yes,No,All]?"
MSG.DIR >CSTR "CP Dir :%S to %S..."
MSG.FILE >CSTR "CP File:%S to %S..."
MSG.OVERWRTE >CSTR "\r\nOverwrite [Yes,No,All]?"
MSG.OK >PSTR "[OK]\r\n"
MSG.ERR >PSTR "[%h]\r\n"
MSG.DONE >PSTR "%D File(s) Copied.\r\n"

View File

@ -24,9 +24,9 @@ OptionList >PSTR "CRYQcryq"
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm,#bQuiet,#bContinue,#bRecurse,#bNoConfirm,#bQuiet
*--------------------------------------
MSG.USAGE >CSTR "Usage : MV [Src File/Dir, *,? wildcards allowed]\r\n -C : Continue on error\r\n -Q : Quiet\r\n -R : Recurse subdirectories\r\n -Y : Dont't prompt for override\r\n"
MSG.DIR >CSTR "MV Dir :%S%S to %S%S..."
MSG.FILE >CSTR "MV File:%S%S to %S%S..."
MSG.OVERWRTE >CSTR "Overwrite [Yes,No,All]?"
MSG.DIR >CSTR "MV Dir :%S to %S..."
MSG.FILE >CSTR "MV File:%S to %S..."
MSG.OVERWRTE >CSTR "\r\nOverwrite [Yes,No,All]?"
MSG.OK >PSTR "[OK]\r\n"
MSG.ERR >PSTR "[%h]\r\n"
MSG.DONE >PSTR "%D File(s) Moved.\r\n"
@ -42,12 +42,17 @@ Index .BS 1
hDIRs .BS X.MAX.RECURSE
hDIRENTs .BS X.MAX.RECURSE
oDIRENTs .BS X.MAX.RECURSE*2
hSrcBasePath .BS 1
hDstBasePath .BS 1
hFilter .BS 1
hDstFileName .BS 1
hSrcFullPath .BS 1
hSrcFile .BS 1
hDstBasePath .BS 1
hDstFileName .BS 1
hDstFullPath .BS 1
hDstFile .BS 1
bPause .BS 1
bCopy .BS 1
hToDelete .BS 1

View File

@ -24,8 +24,8 @@ OptionList >PSTR "CRYQcryq"
OptionVars .DA #bContinue,#bRecurse,#bNoConfirm,#bQuiet,#bContinue,#bRecurse,#bNoConfirm,#bQuiet
*--------------------------------------
MSG.USAGE >CSTR "Usage : RM [File/Dir, *,? wildcards allowed]\r\n -C : Continue on error\r\n -Q : Quiet\r\n -R : Recurse subdirectories\r\n"
MSG.DIR >CSTR "RM Dir :%S%S..."
MSG.FILE >CSTR "RM File:%S%S..."
MSG.DIR >CSTR "RM Dir :%S..."
MSG.FILE >CSTR "RM File:%S..."
MSG.OK >PSTR "[OK]\r\n"
MSG.ERR >PSTR "[%h]\r\n"
MSG.DONE >PSTR "%D File(s) Removed.\r\n"
@ -41,12 +41,12 @@ Index .BS 1
hDIRs .BS X.MAX.RECURSE
hDIRENTs .BS X.MAX.RECURSE
oDIRENTs .BS X.MAX.RECURSE*2
hSrcBasePath .BS 1
hDstBasePath .BS 1
hFilter .BS 1
hDstFileName .BS 1
hSrcFullPath .BS 1
hSrcFile .BS 1
hDstFile .BS 1
bPause .BS 1
bCopy .BS 1
hToDelete .BS 1

View File

@ -132,11 +132,23 @@ CS.INIT >SYSCALL GetArgC
bcs .99
.FIN
.8 ldy #Count
lda #0
.8 >PUSHWI 256
>PUSHBI 0
>SYSCALL GetMem
bcs .9
txa
ldy #hSrcFullPath
sta (pData),y
iny
.DO X.COPY.TO.DEST=1
>PUSHWI 256
>PUSHBI 0
>SYSCALL GetMem
bcs .9
txa
ldy #hDstFullPath
sta (pData),y
.FIN
* lda (pPs)
* ora #S.PS.F.EVENT Now accept events
@ -251,9 +263,11 @@ CS.RUN >SYSCALL GetC
cmp #'.'
beq CS.RUN.NEXT Skip "." & ".."
jsr CS.RUN.BuildFilePath
jmp CS.RUN.DIR
.5 jmp CS.RUN.FILE
.5 jsr CS.RUN.BuildFilePath
jmp CS.RUN.FILE
.6 lda #MLI.ERR.UNSUPST
sec
@ -286,7 +300,7 @@ CS.RUN.LEAVE jsr LeaveSubDir exit this sub dir....
>LDYA L.MSG.DIR
>SYSCALL CPrintFYA
bcs .9
bcs CS.RUN.LEAVE.RTS
jsr CS.RUN.GetSrcFilePath
@ -314,32 +328,27 @@ CS.RUN.LEAVE jsr LeaveSubDir exit this sub dir....
.91 ldy #RC
lda (pData),y get global RC in case of bContinue
sec
.9 rts
CS.RUN.LEAVE.RTS
rts
*--------------------------------------
CS.RUN.DIR .DO X.COPY.TO.DEST=1
>PUSHW ZPFileName Filename
ldy #hDstBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>PUSHW ZPFileName Filename
ldy #hSrcBasePath
ldy #hSrcFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>LDYA L.MSG.DIR
>SYSCALL CPrintFYA
bcs CS.RUN.DIR.RTS
bcs CS.RUN.LEAVE.RTS
jsr CS.RUN.GetDstFilePath
>PUSHW L.STAT
>PUSHWI UsrBuf256
ldy #hDstFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>SYSCALL Stat
bcs .3 File Not exists...go create
@ -376,7 +385,10 @@ CS.RUN.DIR .DO X.COPY.TO.DEST=1
lda #0
bra .4
.3 >LDYAI UsrBuf256
.3 ldy #hDstFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>SYSCALL MKDirYA
.4 jsr CS.RUN.CheckErr
@ -400,10 +412,13 @@ CS.RUN.FILE ldy #bQuiet
.14 .DO X.COPY.TO.DEST=1
jsr CS.RUN.GetDstFilePath
>PUSHW L.STAT
>PUSHWI UsrBuf256
ldy #hDstFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>SYSCALL Stat
bcs .2 File Not exists...go create
@ -470,9 +485,10 @@ CS.RUN.FILE ldy #bQuiet
.4 .DO X.DELETE.SOURCE=1
jsr CS.RUN.GetSrcFilePath
>LDYAI UsrBuf256
ldy #hDstFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>SYSCALL NewPStrYA
bcs .9
txa
@ -489,25 +505,14 @@ CS.RUN.FILE ldy #bQuiet
rts
*--------------------------------------
CS.RUN.FILE.MSG .DO X.COPY.TO.DEST=1
ldy #hDstFileName
lda (pData),y
beq .1
>SYSCALL GetMemPtrA
>PUSHYA
bra .2
.1 >PUSHW ZPFileName
.2 ldy #hDstBasePath
ldy #hDstFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
.FIN
>PUSHW ZPFileName
ldy #hSrcBasePath
ldy #hDstFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
@ -518,26 +523,18 @@ CS.RUN.FILE.MSG .DO X.COPY.TO.DEST=1
*--------------------------------------
.DO X.COPY.TO.DEST=1
.DO X.DELETE.SOURCE=1
CS.RUN.Rename jsr CS.RUN.GetDstFilePath
>LDYAI UsrBuf256
>SYSCALL NewPStrYA
stx .1+1
CS.RUN.Rename ldy #hDstFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
jsr CS.RUN.GetSrcFilePath
>PUSHWI UsrBuf256
ldy #hSrcFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>SYSCALL Rename
php
pha
.1 lda #$ff
>SYSCALL FreeMemA
pla
plp
rts
.9 bra .9
.FIN
.FIN
*--------------------------------------
@ -551,9 +548,11 @@ CS.RUN.CopyStart
>PUSHB (ZPFileStat),y
>PUSHBI SYS.FOpen.R
jsr CS.RUN.GetSrcFilePath
ldy #hSrcFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHWI UsrBuf256
>PUSHYA
>SYSCALL FOpen
bcs .99
@ -568,9 +567,11 @@ CS.RUN.CopyStart
>PUSHB (ZPFileStat),y
>PUSHBI SYS.FOpen.W+SYS.FOpen.X
jsr CS.RUN.GetDstFilePath
ldy #hDstFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHWI UsrBuf256
>PUSHYA
>SYSCALL FOpen
bcs .9
@ -717,35 +718,51 @@ CS.RUN.CheckErr bcs .1
.8 clc
rts
*--------------------------------------
CS.RUN.GetSrcFilePath
CS.RUN.BuildFilePath
ldy #hSrcBasePath
jsr CS.RUN.GeFilePath
>PUSHW ZPFileName
>PUSHWI UsrBuf256
>SYSCALL PStrCat
rts
*--------------------------------------
CS.RUN.GetDstFilePath
ldy #hDstBasePath
jsr CS.RUN.GeFilePath
ldy #hDstFileName
lda (pData),y
beq .9
>SYSCALL GetMemPtrA
>PUSHYA
>PUSHWI UsrBuf256
>SYSCALL PStrCat
.9 rts
*--------------------------------------
CS.RUN.GeFilePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
>PUSHWI UsrBuf256
ldy #hSrcFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>STYA ZPPtr1
>PUSHYA
>SYSCALL PStrCpy
>PUSHW ZPFileName
>PUSHW ZPPtr1
>SYSCALL PStrCat
.DO X.COPY.TO.DEST=1
ldy #hDstBasePath
lda (pData),y
>SYSCALL GetMemPtrA
>PUSHYA
ldy #hDstFullPath
lda (pData),y
>SYSCALL GetMemPtrA
>STYA ZPPtr1
>PUSHYA
>SYSCALL PStrCpy
ldy #hDstFileName
lda (pData),y
beq .1
>SYSCALL GetMemPtrA
>PUSHYA
bra .2
.1 >PUSHW ZPFileName
.2 >PUSHW ZPPtr1
>SYSCALL PStrCat
.FIN
rts
*--------------------------------------
CS.DOEVENT sec
@ -754,14 +771,9 @@ CS.DOEVENT sec
CS.QUIT jsr LeaveSubDir
bcc CS.QUIT
ldy #hToDelete
ldy #bCopy
lda (pData),y
beq .1
>SYSCALL FreeMemA
.1 ldy #bCopy
lda (pData),y
bpl .2
bpl .1
ldy #hSrcFile
lda (pData),y
@ -771,19 +783,29 @@ CS.QUIT jsr LeaveSubDir
lda (pData),y
>SYSCALL FCloseA
.2 ldy #hDstFilename
lda (pData),y
beq .3
>SYSCALL FreeMemA
.1 ldy #hToDelete
jsr CS.QUIT.FREE
.3 ldy #hFilter
lda (pData),y
beq .8
>SYSCALL FreeMemA
ldy #hDstFilename
jsr CS.QUIT.FREE
.8 clc
ldy #hFilter
jsr CS.QUIT.FREE
ldy #hDstFullPath
jsr CS.QUIT.FREE
ldy #hSrcFullPath
jsr CS.QUIT.FREE
clc
rts
*--------------------------------------
CS.QUIT.FREE lda (pData),y
beq .9
>SYSCALL FreeMemA
.9 rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/BIN/X.CPMVRM.S
LOAD /A2OSX.SRC/BIN/MV.S