Kernel 0.92+

This commit is contained in:
Rémy GIBERT 2019-02-26 16:50:42 +00:00
parent 6d95c5b31e
commit b9aacd89f5
14 changed files with 75 additions and 64 deletions

View File

@ -9,7 +9,7 @@ short int args2argv(char* args, char* argv[])
## ASM
`>PUSHW argv`
`>LDYA args`
`>SYSCALL Args2ArgV
`>SYSCALL Args2ArgV`
## RETURN VALUE
A = Arg count
@ -45,7 +45,7 @@ none
`>PUSHW DRV.CS.END`
`>PUSHW DRV.CS.START`
`>LDYA L.SRC`
`SYSCALL insdrv`
`>SYSCALL insdrv`
## RETURN VALUE
Y,A = Ptr to installed driver
@ -695,7 +695,7 @@ Print A (char) to StdOut
## ASM
**In:**
`lda caracter`
`lda character`
`>SYSCALL putchar`
## RETURN VALUE
@ -760,25 +760,25 @@ Prints C-Style String
## ASM
**In:**
PrintF : (example is for printing Y,A as integer : format="%I", 2 bytes)
`>PUSHYA`
`>PUSHYA` #I
`>PUSHBI 2` #bytecount
`...`
`>PUSHBI bytecount`
`>LDYAI format`
`>SYSCALL printf`
SPrintF :
`>PUSHYA`
`...`
`>PUSHBI bytecount`
`>PUSHWI format`
`>LDYAI str`
`>SYSCALL sprintf`
FPrintF :
`>PUSHYA`
`>PUSHYA` #I
`>PUSHBI 2` #bytecount
`...`
`>PUSHBI bytecount`
`>PUSHWI format`
`lda hFILE`
`>SYSCALL fprintf`
SPrintF :
`>PUSHYA` #I
`>PUSHBI 2` #bytecount
`...`
`>PUSHWI format`
`>LDYAI str`
`>SYSCALL sprintf`
## RETURN VALUE
CC : success, Y,A = bytes sent

Binary file not shown.

View File

@ -90,9 +90,9 @@ CS.INIT
>STA.G hBuf
>PUSHBI 0
>LDYA L.MSG.Init
>SYSCALL printf
* >PUSHBI 0
* >LDYA L.MSG.Init
* >SYSCALL printf
clc
.9 rts

View File

@ -124,7 +124,7 @@ DumpDevFD ldy #S.FD.DEV.DRVPTR+1
>PUSHYA
>PUSHB.G DEV.FD
>PUSHB (ZPFDPtr) S.FD.T
>PUSHB.G Table.Index
@ -231,8 +231,8 @@ CS.QUIT clc
rts
*--------------------------------------
CS.END
MSG0 .AZ "ID hFD Name Addr. Status Typ/Sub IDString Version Size (BLK)"
MSG1 .AZ "%03d $%h %12s $%H "
MSG0 .AZ "hDev Tp Name Addr. Status Typ/Sub IDString Version Size (BLK)"
MSG1 .AZ "%03d %h %12s $%H "
MSG2.ERR .AZ "Device Error : $%h\r\n"
MSG2 .AZ "%s $%h/$%h %16S %03d.%03d "
MSG2.B .AZ "%10u\r\n"
@ -254,7 +254,6 @@ FD.T.PIPE .AZ "PIPE"
.OR 0
DS.START
Table.Index .BS 1
DEV.FD .BS 1
DEV.DIB .BS S.DIB
DEV.SFLAGS .BS 9
DS.END

View File

@ -53,18 +53,36 @@ CS.RUN >LDYA L.MSG0
>LDA.G FILE.ID
.1 tax
lda OF.Table.hPath,x
beq .7
>SYSCALL GetMemPtr
>PUSHYA
>LDA.G FILE.ID
tax
lda OF.Table.hFD,x
beq .7
>SYSCALL GetMemPtr
>STYA ZPFDPtr
>LDA.G FILE.ID
tax
lda OF.Table.hPath,x
bne .2
lda OF.Table.hFD,x
tax
lda Dev.Table,x
sta ZPFDPtr
clc
adc #S.FD.DEV
tay
lda Dev.Table+1,x
sta ZPFDPtr+1
adc /S.FD.DEV
bra .3
.2 >SYSCALL GetMemPtr
.3 >PUSHYA
lda (ZPFDPtr)
tax
>PUSHW L.FD.T,x
@ -95,8 +113,8 @@ CS.QUIT clc
rts
*--------------------------------------
CS.END
MSG0 .AZ "ID hFD Type Filepath"
MSG1 .AZ "%03d $%h %5s %s\r\n"
MSG0 .AZ "hFILE hFD Type Filepath"
MSG1 .AZ "%03d $%h %5s %s\r\n"
FD.T.REG .AZ "REG"
FD.T.DIR .AZ "DIR"
FD.T.CDEV .AZ "CDEV"

View File

@ -225,7 +225,7 @@ CS.RUN.GETLINE >PUSHWI 256
ldy #S.PS.hStdIn
lda (pPS),y
>DEBUG
.1 >SYSCALL fgets
rts
*--------------------------------------

View File

@ -25,7 +25,7 @@ OptionVars .DA #bContinue,#bRecurse,#bNoConfirm,#bQuiet,#bContinue,#bRecurse,#b
MSG.USAGE .AZ "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 .AZ "MV Dir :%s to %s..."
MSG.FILE .AZ "MV File:%s to %s..."
MSG.OVERWRITE .AZ "Overwrite %S [Yes,No,All]?"
MSG.OVERWRITE .AZ "Overwrite %s [Yes,No,All]?"
MSG.OK .AZ "[OK]"
MSG.ERR .AZ "[%h]\r\n"
MSG.DONE .AZ "%D File(s) Moved.\r\n"

View File

@ -6,20 +6,21 @@ AUTO 4,1
IO.Reset jsr IO.Reset.In
jsr IO.Reset.Out
jsr IO.Reset.Err
rts
IO.Reset.9 rts
*--------------------------------------
IO.Pipe.In ldy #S.PS.hStdOut
lda (pPS),y
pha
>LDA.G IO.hOut
IO.Pipe.In >LDA.G IO.hOut
ldy #S.PS.hStdOut
sta (pPS),y
>STZ.G IO.hOut
pla
>PUSHWI 0 auxtype
>PUSHBI 0 type
>PUSHBI O.RDONLY
>LEA.G IO.NodBuf
>SYSCALL fopen
bcs IO.Reset.9
*--------------------------------------
IO.Set.In pha
jsr IO.Reset.In
@ -67,15 +68,12 @@ IO.Pipe.Out >SYSCALL pipe
>PUSHWI 0 auxtype
>PUSHBI 0 type
>PUSHBI O.RDWR
>PUSHBI O.WRONLY
>LEA.G IO.NodBuf
>SYSCALL fopen
bcc IO.Set.Out
pha
pla
.99 pha
>LDA.G IO.hPipe
>SYSCALL close

View File

@ -281,8 +281,6 @@ CS.RUN.LOOP >SLEEP
.9 rts
*--------------------------------------
CS.RUN.INTERACTIVE
jsr IO.Reset
>LDA.G hInputBuf some commmands left in buffer
beq .10
@ -293,7 +291,8 @@ CS.RUN.INTERACTIVE
>SYSCALL freemem
>STZ.G hInputBuf
.10 jsr CL.Reset
.10 jsr IO.Reset
jsr CL.Reset
jsr CL.PrintPrompt
bcs .9
@ -685,8 +684,7 @@ IO.hIn .BS 1
IO.hOut .BS 1
IO.hErr .BS 1
IO.hPipe .BS 1
IO.NodBuf
* .BS 12 /DEV/PIPExx\0
IO.NodBuf .BS 12 /DEV/PIPExx\0
*--------------------------------------
M32.BUF .BS 12 -1234567890\0
M32.ACC .BS 4

View File

@ -9,7 +9,7 @@ AUTO 4,1
* ## ASM
* `>PUSHW argv`
* `>LDYA args`
* `>SYSCALL Args2ArgV
* `>SYSCALL Args2ArgV`
* ## RETURN VALUE
* A = Arg count
*\--------------------------------------

View File

@ -248,7 +248,7 @@ BIN.Load.1 >LDYA K.S.STAT+S.STAT.P.AUXTYPE
* `>PUSHW DRV.CS.END`
* `>PUSHW DRV.CS.START`
* `>LDYA L.SRC`
* `SYSCALL insdrv`
* `>SYSCALL insdrv`
* ## RETURN VALUE
* Y,A = Ptr to installed driver
*\--------------------------------------

View File

@ -183,12 +183,10 @@ IO.OPEN.DSOCK
*--------------------------------------
IO.OPEN.SSOCK
*--------------------------------------
IO.OPEN.PIPE
* ldy #S.FD.PIPE.S
* lda (pFD),y
* inc
* sta (pFD),y
IO.OPEN.PIPE ldy #S.FD.PIPE.S
lda (pFD),y
inc
sta (pFD),y
clc
rts
*--------------------------------------

View File

@ -212,7 +212,7 @@ K.MkNod >STYA ZPPtr1 pathname
K.MkNod.I ldx #0
.1 lda Nod.Table.hFD,x
.1 lda Nod.Table.hPath,x
beq .2
inx
@ -305,11 +305,11 @@ K.Pipe >LDYAI K.PIPE.SIZE
lda /K.PIPE.SIZE
sta (pFD),y
ldy #S.FD.PIPE.S
lda #1
sta (pFD),y
* ldy #S.FD.PIPE.S
* lda #1
* sta (pFD),y
iny S.FD.PIPE.hMem
ldy #S.FD.PIPE.hMem
.1 lda #$ff Self Modified
sta (pFD),y
txa

View File

@ -1414,7 +1414,7 @@ STDIO.NewHFile sta .4+1 Store hFD
txa hFILE
clc
* clc
.9 rts
*--------------------------------------
STDIO.IOERR lda #MLI.E.IO