Kernel version 0.8 : added PWD alias in SHELL, modified LS to display DIR/ instead of /DIR

This commit is contained in:
Rémy GIBERT 2016-10-25 08:58:15 +02:00
parent e5a43cdc22
commit 8b5d3696a3
9 changed files with 84 additions and 45 deletions

Binary file not shown.

Binary file not shown.

View File

@ -227,7 +227,20 @@ CS.RUN.DIR ldy #bLong
>LDYA L.MSG.DIR >LDYA L.MSG.DIR
>SYSCALL PrintFYA >SYSCALL PrintFYA
ldy #ColCount lda #80/MAX.COL-3
sec
sbc (ZPPtr1)
beq .2
tax
.1 lda #' '
phx
>SYSCALL COutA
plx
dex
bne .1
.2 ldy #ColCount
lda (pData),y lda (pData),y
inc inc
sta (pData),y sta (pData),y
@ -447,8 +460,8 @@ OptionList >PSTR "LR"
OptionVars .DA #bLong,bRecurse OptionVars .DA #bLong,bRecurse
*-------------------------------------- *--------------------------------------
MSG.DEV >CSTR "%15S S%d,D%d Blocks Used:%5D,Total:%5D\n" MSG.DEV >CSTR "%15S S%d,D%d Blocks Used:%5D,Total:%5D\n"
MSG.DIR >CSTR "/%18S" MSG.DIR >CSTR "%S/"
MSG.DIREXT >CSTR "/%15S <dir> %a %S %S\n" MSG.DIREXT >CSTR "%16S <dir> %a %S %S\n"
MSG.FILE >CSTR "%S.%S" MSG.FILE >CSTR "%S.%S"
MSG.FILEEXT >CSTR "%15S %S $%H %a %10u %S %S\n" MSG.FILEEXT >CSTR "%15S %S $%H %a %10u %S %S\n"
*-------------------------------------- *--------------------------------------

View File

@ -105,6 +105,17 @@ InitSrcDirYA >SYSCALL GetFullPathYA
sec sec
rts rts
*-------------------------------------- *--------------------------------------
GetNextEntry ldy #hDIRs
lda (pData),y
tay
lda (pData),y
>SYSCALL READDIRA
rts
*--------------------------------------
EnterSubDirYA >STYA ZPPtr2 save SUBDIR for StrCat EnterSubDirYA >STYA ZPPtr2 save SUBDIR for StrCat
ldy #hDIRs ldy #hDIRs

View File

@ -186,7 +186,8 @@ Cmd.Exec.EXT.BIN
*-------------------------------------- *--------------------------------------
Cmd.Exec.CD lda ARGS Cmd.Exec.CD lda ARGS
bne Cmd.Exec.CD1 bne Cmd.Exec.CD1
ldy #S.PS.hPREFIX
Cmd.Exec.PWD ldy #S.PS.hPREFIX
lda (pPs),y lda (pPs),y
>SYSCALL GetMemPtrA >SYSCALL GetMemPtrA
>PUSHYA >PUSHYA

View File

@ -55,6 +55,7 @@ J.INTCMDS .DA Cmd.Exec.CD
.DA Cmd.Exec.ECHO .DA Cmd.Exec.ECHO
.DA Cmd.Exec.EXIT .DA Cmd.Exec.EXIT
.DA Cmd.Exec.PAUSE .DA Cmd.Exec.PAUSE
.DA Cmd.Exec.PWD
.DA Cmd.Exec.READ .DA Cmd.Exec.READ
.DA Cmd.Exec.SET .DA Cmd.Exec.SET
.DA Cmd.Exec.STARTPROC .DA Cmd.Exec.STARTPROC
@ -428,6 +429,7 @@ CMDS >PSTR "CD"
>PSTR "ECHO" >PSTR "ECHO"
>PSTR "EXIT" >PSTR "EXIT"
>PSTR "PAUSE" >PSTR "PAUSE"
>PSTR "PWD"
>PSTR "READ" >PSTR "READ"
>PSTR "SET" >PSTR "SET"
>PSTR "STARTPROC" >PSTR "STARTPROC"

View File

@ -6,6 +6,7 @@ AUTO 6
.LIST OFF .LIST OFF
*/-------------------------------------- */--------------------------------------
* #GetArgC * #GetArgC
* Returns argument count in the process command line.
* ##In: * ##In:
* none. * none.
* ##Out: * ##Out:
@ -28,7 +29,7 @@ K.GetArgC jsr ARG.InitArgPtr1
*/-------------------------------------- */--------------------------------------
* #GetArgA * #GetArgA
* ##In: * ##In:
* none. * A = argument index.
* ##Out: * ##Out:
* CC : success * CC : success
* Y,A = PStr To Arg[A] * Y,A = PStr To Arg[A]

View File

@ -4,11 +4,16 @@ NEW
INC 1 INC 1
AUTO 6 AUTO 6
.LIST OFF .LIST OFF
*-------------------------------------- */--------------------------------------
* PULLW PString to scan (ex: "192.168.1.5") * #SScanF
* PULLW PString pattern (ex: "%d.%d.%d.%d") * Scan a PStr (in progress)
* PULLW PTR to target buffer * ##In:
*-------------------------------------- * PUSHW PTR to target buffer
* PUSHW PString pattern (ex: "%d.%d.%d.%d")
* %d : byte
* PUSHW PString to scan (ex: "192.168.1.5")
* ##Out:
*\--------------------------------------
K.SScanF jsr PullPtr1Ptr2Ptr3 K.SScanF jsr PullPtr1Ptr2Ptr3
ldy #0 Y = PTR in pattern ldy #0 Y = PTR in pattern
@ -80,7 +85,6 @@ K.SScanF jsr PullPtr1Ptr2Ptr3
.9 sec .9 sec
rts rts
*-------------------------------------- *--------------------------------------
K.SScanF.IncPtr1 dex K.SScanF.IncPtr1 dex
beq .1 beq .1
@ -97,7 +101,7 @@ K.SScanF.IsDigit cmp #'0'
.1 sec .1 sec
rts rts
*/-------------------------------------- */--------------------------------------
* #PrintFYA : * #PrintFYA
* Prints C-Style String * Prints C-Style String
* ##In: * ##In:
* Y,A = PTR to CStr * Y,A = PTR to CStr
@ -129,6 +133,7 @@ K.SScanF.IsDigit cmp #'0'
* %11s 'ABCDEFGH ' * %11s 'ABCDEFGH '
* %011s 'ABCDEFGH000' * %011s 'ABCDEFGH000'
* %2f '3.14' * %2f '3.14'
* ##Out:
*\-------------------------------------- *\--------------------------------------
K.PrintFYA >STYA ZPQuickPtr1 K.PrintFYA >STYA ZPQuickPtr1

View File

@ -22,16 +22,20 @@ MemMgr.ReqFlags .EQ ZPMEMMGR+10 store requested Flags
* - mem.ID=0 always used! useful to test if hMem=0 * - mem.ID=0 always used! useful to test if hMem=0
*-------------------------------------- *--------------------------------------
* PUBLIC * PUBLIC
*-------------------------------------- */--------------------------------------
* K.GetMem * #GetMem
* In: * ##In:
* PULLB = FLAGS * PUSHW = Size Requested
* PULLW = Size Requested * PUSHB = Options
* Out: * S.MEM.F.INIT0 : init memory with 00
* S.MEM.F.ALIGN : page aligned
* ##Out:
* CC : success
* YA = PTR to Mem * YA = PTR to Mem
* X = S.MEM.ID * X = hMem
* CS on err * CS :
*-------------------------------------- * A = EC
*\--------------------------------------
K.GetMem >PULLB MemMgr.ReqFlags store requested flags K.GetMem >PULLB MemMgr.ReqFlags store requested flags
and #S.MEM.F.AUX and #S.MEM.F.AUX
beq .11 beq .11
@ -236,13 +240,14 @@ MemMgr.Init0 ldy #S.MEM.PTR
bne .1 bne .1
.8 rts .8 rts
*-------------------------------------- */--------------------------------------
* K.FreeMemA * #FreeMemA
* In: * ##In:
* A = hMem To Free * A = hMem To Free
* Out: * ##Out:
* X,Y unmodified * none.
*-------------------------------------- * (X,Y unmodified)
*\--------------------------------------
K.FreeMemA phy K.FreeMemA phy
tay tay
@ -328,14 +333,14 @@ K.FreeMemA phy
bra * bra *
*-------------------------------------- *--------------------------------------
K.FreeMemA.ERR >CSTR "***MemMgr:Attempt to Free an already freed hMem at $%H" K.FreeMemA.ERR >CSTR "***MemMgr:Attempt to Free an already freed hMem at $%H"
*-------------------------------------- */--------------------------------------
* K.GetMemPtrA * #GetMemPtrA
* In: * ##In:
* A = hMem * A = hMem
* Out: * ##Out:
* Y,A = PTR to MemBlock * Y,A = PTR to MemBlock
* X unmodified * (X unmodified)
*-------------------------------------- *\--------------------------------------
K.GetMemPtrA jsr K.GetMemByIDA K.GetMemPtrA jsr K.GetMemByIDA
ldy #S.MEM.PTR ldy #S.MEM.PTR
lda (ZPMemMgrSPtr),y lda (ZPMemMgrSPtr),y
@ -344,16 +349,17 @@ K.GetMemPtrA jsr K.GetMemByIDA
lda (ZPMemMgrSPtr),y lda (ZPMemMgrSPtr),y
ply ply
rts rts
*-------------------------------------- */--------------------------------------
* K.GetMemByIDA * #GetMemByIDA
* In: * ##In:
* A = hMem * A = hMem
* Out: * ##Out:
* Y,A = ZPMemMgrSPtr = PTR to S.MEM * Y,A = ZPMemMgrSPtr = PTR to S.MEM
* X unmodified * X unmodified
* *** Optimized for : *\--------------------------------------
* MemMgr.Table is page aligned at $1800 * Optimized for :
* S.MEM is 8 bytes * MemMgr.Table is page aligned at $1800
* S.MEM is 8 bytes
*-------------------------------------- *--------------------------------------
.DO MemMgr.Table=$1800 .DO MemMgr.Table=$1800
.ELSE .ELSE