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 txa
>STA.G hFullPath >STA.G hFullPath
>LDYA ZPPtr1 * >LDYA ZPPtr1
>SYSCALL PrintF.YA * >SYSCALL PrintF.YA
lda #'|' * lda #'|'
>SYSCALL PutChar.A * >SYSCALL PutChar.A
lda #13 * lda #13
>SYSCALL PutChar.A * >SYSCALL PutChar.A
lda #10 * lda #10
>SYSCALL PutChar.A * >SYSCALL PutChar.A
ldy #1 ldy #1
lda (ZPPtr1),y lda (ZPPtr1),y

View File

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

View File

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

View File

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

View File

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