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

Binary file not shown.

View File

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

View File

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

View File

@ -53,18 +53,36 @@ CS.RUN >LDYA L.MSG0
>LDA.G FILE.ID >LDA.G FILE.ID
.1 tax .1 tax
lda OF.Table.hPath,x
beq .7
>SYSCALL GetMemPtr
>PUSHYA
>LDA.G FILE.ID
tax
lda OF.Table.hFD,x lda OF.Table.hFD,x
beq .7
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA ZPFDPtr >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) lda (ZPFDPtr)
tax tax
>PUSHW L.FD.T,x >PUSHW L.FD.T,x
@ -95,8 +113,8 @@ CS.QUIT clc
rts rts
*-------------------------------------- *--------------------------------------
CS.END CS.END
MSG0 .AZ "ID hFD Type Filepath" MSG0 .AZ "hFILE hFD Type Filepath"
MSG1 .AZ "%03d $%h %5s %s\r\n" MSG1 .AZ "%03d $%h %5s %s\r\n"
FD.T.REG .AZ "REG" FD.T.REG .AZ "REG"
FD.T.DIR .AZ "DIR" FD.T.DIR .AZ "DIR"
FD.T.CDEV .AZ "CDEV" FD.T.CDEV .AZ "CDEV"

View File

@ -225,7 +225,7 @@ CS.RUN.GETLINE >PUSHWI 256
ldy #S.PS.hStdIn ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>DEBUG
.1 >SYSCALL fgets .1 >SYSCALL fgets
rts 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.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.DIR .AZ "MV Dir :%s to %s..."
MSG.FILE .AZ "MV File:%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.OK .AZ "[OK]"
MSG.ERR .AZ "[%h]\r\n" MSG.ERR .AZ "[%h]\r\n"
MSG.DONE .AZ "%D File(s) Moved.\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 IO.Reset jsr IO.Reset.In
jsr IO.Reset.Out jsr IO.Reset.Out
jsr IO.Reset.Err jsr IO.Reset.Err
rts IO.Reset.9 rts
*-------------------------------------- *--------------------------------------
IO.Pipe.In ldy #S.PS.hStdOut IO.Pipe.In >LDA.G IO.hOut
lda (pPS),y
pha
>LDA.G IO.hOut
ldy #S.PS.hStdOut ldy #S.PS.hStdOut
sta (pPS),y sta (pPS),y
>STZ.G IO.hOut >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 IO.Set.In pha
jsr IO.Reset.In jsr IO.Reset.In
@ -67,15 +68,12 @@ IO.Pipe.Out >SYSCALL pipe
>PUSHWI 0 auxtype >PUSHWI 0 auxtype
>PUSHBI 0 type >PUSHBI 0 type
>PUSHBI O.RDWR >PUSHBI O.WRONLY
>LEA.G IO.NodBuf >LEA.G IO.NodBuf
>SYSCALL fopen >SYSCALL fopen
bcc IO.Set.Out bcc IO.Set.Out
pha
pla
.99 pha .99 pha
>LDA.G IO.hPipe >LDA.G IO.hPipe
>SYSCALL close >SYSCALL close

View File

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

View File

@ -9,7 +9,7 @@ AUTO 4,1
* ## ASM * ## ASM
* `>PUSHW argv` * `>PUSHW argv`
* `>LDYA args` * `>LDYA args`
* `>SYSCALL Args2ArgV * `>SYSCALL Args2ArgV`
* ## RETURN VALUE * ## RETURN VALUE
* A = Arg count * 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.END`
* `>PUSHW DRV.CS.START` * `>PUSHW DRV.CS.START`
* `>LDYA L.SRC` * `>LDYA L.SRC`
* `SYSCALL insdrv` * `>SYSCALL insdrv`
* ## RETURN VALUE * ## RETURN VALUE
* Y,A = Ptr to installed driver * Y,A = Ptr to installed driver
*\-------------------------------------- *\--------------------------------------

View File

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

View File

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

View File

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