Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-10-10 08:04:11 +02:00
parent 0511b68265
commit 9180188da7
3 changed files with 36 additions and 9 deletions

Binary file not shown.

View File

@ -62,14 +62,9 @@ CMD.POPD >LDA.G PUSHD.STACK
CMD.POPD.RTS rts
CMD.POPD.CSYN jmp CMD.E.CSYN
*--------------------------------------
CMD.PWD ldy #S.PS.hCWD
lda (pPs),y
>SYSCALL GetMemPtr
>SYSCALL puts
rts
*--------------------------------------
CMD... lda (ZPArgVBufPtr)
bne CMD.POPD.CSYN
>LDYA L.CD..
bra CMD.CD.YA
*--------------------------------------
@ -479,13 +474,23 @@ CMD.MD lda (ZPArgVBufPtr)
>SYSCALL MKDir
rts
*--------------------------------------
CMD.PWD ldy #S.PS.hCWD
lda (pPs),y
>SYSCALL GetMemPtr
>SYSCALL puts
rts
*--------------------------------------
CMD.REN lda (ZPArgVBufPtr)
beq .9
>PUSHW ZPArgVBufPtr
>LDYA ZPArgVBufPtr
>SYSCALL puts
jsr CORE.ArgV.Next
lda (ZPArgVBufPtr)
beq .90
>LDYA ZPArgVBufPtr
>SYSCALL puts
>LDYA ZPArgVBufPtr
>SYSCALL Rename
rts

View File

@ -76,7 +76,7 @@ K.StrToUL clc Unsigned
adc ZPPtr2+1
ldy #1
sta (ZPPtr1),y
K.StrToUL.rts rts
K.StrToUL.rts rts
*/--------------------------------------
* # atol
* Convert String to 32 bits long
@ -102,7 +102,8 @@ K.AToL.I jsr MATH.Dec2ACC32
dex
bpl .3
tya Y = A = Count processed
* clc.9
* clc
.9
rts
*/--------------------------------------
* # atoi
@ -149,25 +150,32 @@ STDLIB.realpath.I
ldx #SYS.ExpandStr
jsr K.SYSCALL2
bcs K.atoi.RTS
>STYA ZPPtr1
stx .99+1 save expanded buffer hMem
ldx #$ff
lda (ZPPtr1)
beq .1
cmp #'/' full path starting with '/'?
beq .3 yes, do not append to current prefix
.1 ldy #S.PS.hCWD
lda (pPs),y
jsr K.GetMemPtr
>STYA ZPPtr2
ldy #$ff
.2 iny
inx
lda (ZPPtr2),y
sta K.Buf256,x
bne .2
dex
.3 ldy #$ff
.4 iny
@ -175,6 +183,7 @@ STDLIB.realpath.I
lda (ZPPtr1),y
sta K.Buf256,x
bne .4
dex
beq .81 we have '/'....nothing to do...
*--------------------------------------
@ -183,12 +192,15 @@ STDLIB.realpath.I
ldx #1 skip leading /
lda K.Buf256,x
.5 ldy #0 dot counter=0
.6 cmp #'/'
beq .8
cmp #'.'
bne .7
iny
.HS 2C BIT ABS, skip "LDY #0"
.7 ldy #0 not a dot....reset dot counter
@ -196,19 +208,25 @@ STDLIB.realpath.I
inx
lda K.Buf256,x
bne .6 we have /dir\0
.8 tya
beq .80 Y was 0....nothing to do...
dey "./" ?
bne .9 no..
lda K.Buf256-2,x
cmp #'/' "/./" ?
bne .80
dex
dex
jsr K.RealPath.RemoveAtX we found "/./", remove,useless....
bra .80
.9 dey "../" ?
bne .99 ".../" ??!!...mmm...syntax error
lda K.Buf256-3,x
cmp #'/' "/../" ?
bne .80
@ -225,6 +243,7 @@ STDLIB.realpath.I
lda K.Buf256,x go to "/dir"
cmp #'/'
bne .10
jsr K.RealPath.RemoveAtX ...remove "/dir"
.80 inx
lda K.Buf256,x
@ -234,11 +253,14 @@ STDLIB.realpath.I
.82 lda #$ff SELF MODIFIED
bpl .88
>LDYAI K.Buf256
ldx #SYS.StrDup BANK 2
jmp K.SYSCALL2
.88 clc
rts
.99 lda #$ff SELF MODIFIED
jsr K.FreeMem