Kernel 0.9.1 : Code reorganization & move to CSTR, new RealPath.YA API for SHELL CD command

This commit is contained in:
Rémy GIBERT 2017-09-29 16:57:20 +02:00
parent 703779cec0
commit 2baa185d88
7 changed files with 41 additions and 52 deletions

Binary file not shown.

Binary file not shown.

View File

@ -23,14 +23,14 @@ InitSrcDirYA >SYSCALL GetFullPath.YA
txa
>STA.G hFullPath
>LDYA ZPPtr1
>SYSCALL PrintF.YA
lda #'|'
>SYSCALL PutChar.A
lda #13
>SYSCALL PutChar.A
lda #10
>SYSCALL PutChar.A
* >LDYA ZPPtr1
* >SYSCALL PrintF.YA
* lda #'|'
* >SYSCALL PutChar.A
* lda #13
* >SYSCALL PutChar.A
* lda #10
* >SYSCALL PutChar.A
ldy #1
lda (ZPPtr1),y

View File

@ -352,6 +352,7 @@ CS.CHARIN tax Save Char
clc Len-1-Ptr !!!!!
>SBC.G CmdBufPtr
beq .30
phx
tax
>LDA.G CmdBuflen
@ -374,12 +375,16 @@ CS.CHARIN tax Save Char
>INC.G CmdBufPtr
>CMP.G CmdBuflen
beq .8
bne .8
jmp CmdLine.PRINTPTR
tay
lda #0
sta (ZPCMDBuf),y
.8 clc
clc
rts
.8 jmp CmdLine.PRINTPTR
*--------------------------------------
CS.CHARIN.CTRL
cpx #13 CR

View File

@ -397,19 +397,6 @@ PullPtr1Ptr2 clc
>PULLW ZPPtr3
.9 rts
*--------------------------------------
K.DEBUG >SYSCALL PrintF.YA
lda #'@'
>SYSCALL PutChar.A
lda #13
>SYSCALL PutChar.A
lda #10
>SYSCALL PutChar.A
>DEBUG
rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.JMP
LOAD /A2OSX.SRC/SYS/KERNEL.S

View File

@ -115,9 +115,7 @@ K.PutChar.A.FIFO
rts
.9 lda #MLI.ERR.VOLFULL
sec
rts
.HS 2C bit abs
.99 lda #MLI.ERR.EOF
sec
rts
@ -736,7 +734,7 @@ K.SScanF.IsDigit
* %2f : '3.14'
*\--------------------------------------
K.SPrintF.YA >STYA ZPPtr1
>PULLW Printf.Cout.Ptr+1
* >PULLW Printf.Cout.Ptr+1
K.FPrintF.YA >STYA ZPPtr1
@ -1087,7 +1085,7 @@ PrintF.SS ldy #$00 PSTR
*--------------------------------------
Printf.Cout jmp K.PutChar.A
Printf.Cout.Ptr sta $ffff Self modified
*Printf.Cout.Ptr sta $ffff Self modified
*--------------------------------------
STDIO.PullMLIPath
>PULLYA
@ -1130,6 +1128,12 @@ STDIO.IOERR lda #MLI.ERR.IO
sec
rts
*--------------------------------------
TYPES .AS "-dbclssp"
ACCESS .AS "rwxrwxrwx"
SIGN .BS 1
PADLEN .BS 1
PADCHAR .BS 1
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.STDIO
LOAD /A2OSX.SRC/SYS/KERNEL.S

View File

@ -26,7 +26,7 @@ K.AToI.YA
* Convert String to 32 bits int
* ## In:
* PUSHW PTR to target buffer DWORD
* PUSHW Source String (PSTR)
* PUSHW Source String (C-Sring)
* ## Out:
*\--------------------------------------
K.AToL jsr PullPtr1Ptr2 PSTR in Ptr1,buffer in Ptr2
@ -38,25 +38,23 @@ K.AToL jsr PullPtr1Ptr2 PSTR in Ptr1,buffer in Ptr2
lda (ZPPtr1)
beq .2
ldy #0
ldy #$ff
.1 iny
lda (ZPPtr1),y
beq .2
cmp #'0'
bcc .2
cmp #'9'+1
bcs .2
inx
sta ASCBUF,x
inx
cpx #10
beq .2
tya
cmp (ZPPtr1)
bne .1
.2 stx ASCBUF
.2 stz ASCBUF,x
jsr DEC2HEX
ldy #3
@ -69,12 +67,6 @@ K.AToL jsr PullPtr1Ptr2 PSTR in Ptr1,buffer in Ptr2
clc
rts
*--------------------------------------
TYPES .AS "-dbclssp"
ACCESS .AS "rwxrwxrwx"
SIGN .BS 1
PADLEN .BS 1
PADCHAR .BS 1
*--------------------------------------
* Convert HEXBUF to ASCBUF decimal padded with 0
*--------------------------------------
HEX2DEC ldx #4
@ -213,7 +205,6 @@ ASCBUF .BS 12 LEN + sign + 10 digits ($FFFFFFFF=4.294.967.295)
* CS : A = Error Code
*\--------------------------------------
K.RealPath.YA >STYA ZPPtr1
ldx #$ff
lda (ZPPtr1)
@ -243,9 +234,11 @@ K.RealPath.YA >STYA ZPPtr1
inx
lda (ZPPtr1),y
sta K.Buf256,x
bne .3 X=LEN, K.Buf256 = /dir1..../file(/) /x0
bne .3
*--------------------------------------
.4 dex
* X=LEN, K.Buf256 = /dir1../file(/) /x0
dex
beq .89 we have '/'....nothing to do...
lda K.Buf256,x Skip any / at the end of string....
@ -267,7 +260,10 @@ K.RealPath.YA >STYA ZPPtr1
.HS 2C BIT ABS, skip "LDY #0"
.7 ldy #0 not a dot....reset dot counter
bra .80 always, should end with a '/'
txa
beq .89
dex
bra .6 always, should end with a '/'
.8 tya
beq .80 Y was 0....nothing to do...
@ -286,9 +282,9 @@ K.RealPath.YA >STYA ZPPtr1
jsr K.RealPath.RemoveAtX remove "/.."
dex skip actual "/"
.11 dex
.11 lda K.Buf256,x go to "/dir"
lda K.Buf256,x go to "/dir"
cmp #'/'
bne .11
@ -300,9 +296,6 @@ K.RealPath.YA >STYA ZPPtr1
bra .5
.89 >LDYAI K.Buf256
jsr K.DEBUG
>LDYAI K.Buf256
jmp K.NewStr.YA
.90 lda #SYSMGR.ERRSYN