Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2019-09-02 17:34:10 +02:00
parent 3bee887a66
commit e6abb0017d
7 changed files with 73 additions and 38 deletions

Binary file not shown.

View File

@ -765,8 +765,37 @@ CSH.GetNumOnStack
>PUSHWI ZPFileBufPtr
>LDYA ZPFileBufPtr
>SYSCALL StrToL
ldx ZPVarType
cpx #CSH.T.UCHAR
bcc .2
>SYSCALL StrToUL
bra .3
.2 >SYSCALL StrToL
.3 bcs .9
ldy ZPVarType
lda CSH.TYPESIZE,y
cmp #4
beq .8
cmp #2
bne .4
ldy #1
>PULLA
sta (pStack),y
>PULLA
sta (pStack),y
clc
rts
.4 >PULLA
inc pStack
inc pStack
sta (pStack)
.8 clc
.9 rts
*--------------------------------------
* Input : ZPFileBufPtr, A = Var Type, Value on Stack
@ -1164,8 +1193,7 @@ CSH.SIZEOF txa
*--------------------------------------
CSH.EXEC jmp (J.CSH.EXEC,x)
*--------------------------------------
EXEC.printf >DEBUG
>SYSCALL printf2
EXEC.printf >SYSCALL printf2
rts
*--------------------------------------
EXEC.puts >PULLYA
@ -1176,6 +1204,8 @@ EXEC.cos >FPU COS
rts
*--------------------------------------
EXEC.getchar >SYSCALL getchar
>PUSHA
>DEBUG
rts
*--------------------------------------
MAN

View File

@ -228,7 +228,7 @@ SYS.AToI .EQ $72
SYS.AToL .EQ $74
SYS.StrToF .EQ $76
SYS.StrToL .EQ $78
* .EQ $7A
SYS.StrToUL .EQ $7A
SYS.RealPath .EQ $7C
* .EQ $7E
*--------------------------------------

View File

@ -267,7 +267,8 @@ GP.SetARG ldx #FPU.SETARG
.HS 2C BIT ABS
GP.SetFAC ldx #FPU.SETFAC
>LDYA pStack
lda pStack
ldy pStack+1
bra GP.RomCall
*/--------------------------------------
* # float

View File

@ -73,7 +73,7 @@ K.SYSCALL .DA 0 $00
.DA K.AToL
.DA K.StrToF
.DA K.StrToL
.DA 0
.DA K.StrToUL
.DA K.RealPath
.DA 0
*--------------------------------------

View File

@ -245,7 +245,14 @@ PrintF.hFILE .BS 1
* `>PUSHBI 2` #bytecount
* `>SYSCALL printf2`
*--------------------------------------
K.PrintF2 lda (pStack) Bytecount
K.PrintF2 >LDYAI K.IOBuf
>STYA pIOBuf
ldy #S.PS.hStdOut
lda (pPs),y
sta PrintF.hFILE
lda (pStack) Bytecount
inc
tay
@ -255,15 +262,12 @@ K.PrintF2 lda (pStack) Bytecount
lda (pStack),y format HI
sta ZPPtr2+1
ldy #S.PS.hStdOut
lda (pPs),y
sta PrintF.hFILE
>LDYAI K.IOBuf
>STYA pIOBuf
bra K.PrintF2.1
K.FPrintf2 lda (pStack) Bytecount
K.FPrintf2 >LDYAI K.IOBuf
>STYA pIOBuf
lda (pStack) Bytecount
inc
tay
@ -277,8 +281,6 @@ K.FPrintf2 lda (pStack) Bytecount
lda (pStack),y hFILE
sta PrintF.hFILE
>LDYAI K.IOBuf
>STYA pIOBuf
bra K.PrintF2.1
K.SPrintf2 lda (pStack) Bytecount
@ -300,7 +302,9 @@ K.SPrintf2 lda (pStack) Bytecount
lda (pStack),y str HI
sta pIOBuf+1
K.PrintF2.1 stz PrintF.Cnt
K.PrintF2.1 sty PrintF2.Exit.Cnt+1
stz PrintF.Cnt
stz PrintF.Cnt+1
lda pStack
@ -405,7 +409,7 @@ K.PrintF2.1 stz PrintF.Cnt
.20 jsr PrintF.COut
bcc .11
*--------------------------------------
.99 bra PrintF2.LocalCleanUp
.99 bra PrintF2.Exit
*--------------------------------------
.8 ldx PrintF.hFILE
beq .80 Writing to buffer, append \0
@ -428,16 +432,16 @@ K.PrintF2.1 stz PrintF.Cnt
.81 >LDYA PrintF.Cnt
* clc
*--------------------------------------
PrintF2.LocalCleanUp
php
PrintF2.Exit php
pha
lda pLocal
sec ByteCnt byte
adc (pLocal) ... ByteCnt
sta pStack CC
lda pStack
sec +Bytecount byte
PrintF2.Exit.Cnt
adc #$ff SELF MODIFIED
sta pStack
pla
plp
PrintF2.LocalCleanUp.RTS
rts
*--------------------------------------
K.SPrintF stz PrintF.hFILE
@ -721,25 +725,20 @@ PrintF.F clc
bcc .1
bne PrintF.StrNum.RTS
.1 tya
sec +1
.1 sta PrintF.LocalGetByte+1
tya
sec +1 for bytecount byte
adc pStack
tay
lda pStack+1
ldy pStack+1 A,Y = float
ldx #FPU.SETFAC
jsr GP.ROMCALL
lda PrintF.LocalGetByte+1
clc
adc #5
sta PrintF.LocalGetByte+1
ldy #A2osX.NumStrBuf
ldy #A2osX.NumStrBuf+1 FOUT.1 will do a DEY
ldx #FPU.FOUT
jsr GP.ROMCALL
PrintF.StrNum ldy #0
.2 lda A2osX.NumStrBuf,y

View File

@ -38,6 +38,11 @@ K.strtof pha
*\--------------------------------------
K.AToF >STYA TXTPTR Ptr to source string
lda pStack
sec
sbc #5
sta pStack
jsr CHARGOT
ldx #FPU.FIN