mirror of
https://github.com/A2osX/A2osX.git
synced 2024-07-13 13:29:04 +00:00
Kernel 0.93+
This commit is contained in:
parent
2261b0a937
commit
9269809d3e
Binary file not shown.
@ -20,12 +20,6 @@ CSH.StackPtr .BS 1
|
|||||||
|
|
||||||
CSH.CmdSave .BS 1
|
CSH.CmdSave .BS 1
|
||||||
|
|
||||||
CSH.ACCT .BS 1
|
|
||||||
CSH.ACC .BS 5
|
|
||||||
|
|
||||||
CSH.ARGT .BS 1
|
|
||||||
CSH.ARG .BS 5
|
|
||||||
|
|
||||||
CSH.LookupOpt .BS 1
|
CSH.LookupOpt .BS 1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MAN
|
MAN
|
||||||
|
@ -86,7 +86,7 @@ CSH.Run jsr CSH.GetCharNB
|
|||||||
|
|
||||||
jmp (J.CSH.KW,x)
|
jmp (J.CSH.KW,x)
|
||||||
|
|
||||||
.4 jsr CSH.GetVarValue
|
.4 jsr CSH.GetVar
|
||||||
bcs .5
|
bcs .5
|
||||||
|
|
||||||
jsr CSH.GetCharNB
|
jsr CSH.GetCharNB
|
||||||
@ -100,7 +100,7 @@ CSH.Run jsr CSH.GetCharNB
|
|||||||
jsr CSH.ExpEval
|
jsr CSH.ExpEval
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
jsr CSH.StoreACCToVar
|
jsr CSH.SetVarValue
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
jsr CSH.GetChar
|
jsr CSH.GetChar
|
||||||
@ -153,8 +153,8 @@ CSH.IF jsr CSH.GetCharNB
|
|||||||
cmp #'{'
|
cmp #'{'
|
||||||
bne .9
|
bne .9
|
||||||
|
|
||||||
jsr CSH.IsACC0
|
jsr CSH.IsValue0
|
||||||
bcc .6 eval returned ACC=0, skip {{....}}
|
bcc .6 Value=0, skip {{....}}
|
||||||
|
|
||||||
jsr CSH.GetNextCharNB Skip '{'
|
jsr CSH.GetNextCharNB Skip '{'
|
||||||
bcs .99
|
bcs .99
|
||||||
@ -322,7 +322,7 @@ CSH.TYPE stx ZPVarType
|
|||||||
|
|
||||||
bcs .99
|
bcs .99
|
||||||
|
|
||||||
jsr CSH.StoreACCToVar Update value to this var
|
jsr CSH.SetVarValue Update value to this var
|
||||||
|
|
||||||
jsr CSH.GetChar
|
jsr CSH.GetChar
|
||||||
bcs .9
|
bcs .9
|
||||||
@ -451,9 +451,7 @@ CSH.ExpEval ldx ZPPtr2
|
|||||||
phx
|
phx
|
||||||
|
|
||||||
sta ZPPtr2 save Type
|
sta ZPPtr2 save Type
|
||||||
|
|
||||||
jsr CSH.ZeroACC
|
|
||||||
|
|
||||||
.10 lda #$ff
|
.10 lda #$ff
|
||||||
sta ZPPtr2+1 Reset BOP1
|
sta ZPPtr2+1 Reset BOP1
|
||||||
|
|
||||||
@ -463,9 +461,10 @@ CSH.ExpEval ldx ZPPtr2
|
|||||||
.20 jsr CSH.IsLetter Fnc or Var ?
|
.20 jsr CSH.IsLetter Fnc or Var ?
|
||||||
bcs .2
|
bcs .2
|
||||||
|
|
||||||
jsr CSH.GetVarValue
|
jsr CSH.GetVar
|
||||||
bcs .1
|
bcs .1
|
||||||
|
|
||||||
|
jsr CSH.GetVarValue Get value on stack
|
||||||
bra .11
|
bra .11
|
||||||
|
|
||||||
.1 jsr CSH.FnEval X = function index
|
.1 jsr CSH.FnEval X = function index
|
||||||
@ -475,7 +474,7 @@ CSH.ExpEval ldx ZPPtr2
|
|||||||
.2 jsr CSH.IsDigit10 number ?
|
.2 jsr CSH.IsDigit10 number ?
|
||||||
bcs .3
|
bcs .3
|
||||||
|
|
||||||
jsr CSH.GetNumInACC
|
jsr CSH.GetNumOnStack
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
.11 jsr CSH.GetCharNB
|
.11 jsr CSH.GetCharNB
|
||||||
@ -500,7 +499,8 @@ CSH.ExpEval ldx ZPPtr2
|
|||||||
|
|
||||||
stx ZPPtr2+1
|
stx ZPPtr2+1
|
||||||
|
|
||||||
jsr CSH.ACC2ARG
|
jsr CSH.PushValueOnStack
|
||||||
|
|
||||||
jsr CSH.GetCharNB
|
jsr CSH.GetCharNB
|
||||||
bcc .20 go check for an ARG
|
bcc .20 go check for an ARG
|
||||||
bra .9
|
bra .9
|
||||||
@ -576,10 +576,10 @@ CSH.AddContCharP
|
|||||||
phy
|
phy
|
||||||
|
|
||||||
lda #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.CHAR
|
lda #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.CHAR
|
||||||
>STA.G CSH.ACCT
|
sta ZPVarType
|
||||||
|
|
||||||
>LDYA ZPCSHConst
|
>LDYA ZPCSHConst
|
||||||
>STYA.G CSH.ACC
|
>STYA ZPVarData
|
||||||
|
|
||||||
pla
|
pla
|
||||||
sec
|
sec
|
||||||
@ -691,7 +691,8 @@ CSH.ZPPtr1AddAp1
|
|||||||
inc ZPPtr1+1
|
inc ZPPtr1+1
|
||||||
.1 rts
|
.1 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CSH.GetNumInACC >LDA.G CSH.ACCT
|
CSH.GetNumOnStack
|
||||||
|
lda ZPVarType
|
||||||
cmp #CSH.T.FLOAT
|
cmp #CSH.T.FLOAT
|
||||||
bcc .1
|
bcc .1
|
||||||
|
|
||||||
@ -699,9 +700,6 @@ CSH.GetNumInACC >LDA.G CSH.ACCT
|
|||||||
>LDYA ZPFileBufPtr
|
>LDYA ZPFileBufPtr
|
||||||
|
|
||||||
>SYSCALL StrToF
|
>SYSCALL StrToF
|
||||||
* bcs .9
|
|
||||||
>PULLF.G CSH.ACC
|
|
||||||
clc
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.1 >PUSHBI 10
|
.1 >PUSHBI 10
|
||||||
@ -710,37 +708,9 @@ CSH.GetNumInACC >LDA.G CSH.ACCT
|
|||||||
>LDYA ZPFileBufPtr
|
>LDYA ZPFileBufPtr
|
||||||
|
|
||||||
>SYSCALL StrToL
|
>SYSCALL StrToL
|
||||||
bcs .9
|
|
||||||
>PULLL.G CSH.ACC
|
|
||||||
clc
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CSH.ZeroACC lda #0
|
|
||||||
ldx #5
|
|
||||||
ldy #CSH.ACC
|
|
||||||
|
|
||||||
.1 sta (pData),y
|
|
||||||
iny
|
|
||||||
dex
|
|
||||||
bne .1
|
|
||||||
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
CSH.ACC2ARG >LEA.G CSH.ACCT
|
|
||||||
>STYA ZPPtr1
|
|
||||||
|
|
||||||
>LEA.G CSH.ARGT
|
|
||||||
>STYA ZPPtr2
|
|
||||||
|
|
||||||
ldy #5
|
|
||||||
|
|
||||||
.1 lda (ZPPtr1),y
|
|
||||||
sta (ZPPtr2),y
|
|
||||||
dey
|
|
||||||
bpl .1
|
|
||||||
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
* Input : ZPFileBufPtr, A = Var Type, Value on Stack
|
* Input : ZPFileBufPtr, A = Var Type, Value on Stack
|
||||||
* Output : Y,A = ZPVarID
|
* Output : Y,A = ZPVarID
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -787,11 +757,7 @@ CSH.AddVar sta ZPVarType
|
|||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Input : ZPFileBufPtr, A = Var Type
|
CSH.GetVar sta ZPVarType
|
||||||
* Output : Value on Stack
|
|
||||||
*--------------------------------------
|
|
||||||
CSH.GetVarValue
|
|
||||||
sta ZPVarType
|
|
||||||
|
|
||||||
>PUSHW ZPFileBufPtr
|
>PUSHW ZPFileBufPtr
|
||||||
>LDA.G CSH.hSymbols
|
>LDA.G CSH.hSymbols
|
||||||
@ -808,33 +774,65 @@ CSH.GetVarValue
|
|||||||
|
|
||||||
inc ZPFileBufPtr+1
|
inc ZPFileBufPtr+1
|
||||||
|
|
||||||
.1
|
.1 ldx ZPVarType
|
||||||
|
cpx ZPVarData
|
||||||
|
bne .99
|
||||||
|
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
.99 lda #CSH.E.TMISMATCH
|
||||||
|
sec
|
||||||
|
.9
|
||||||
|
CSH.GetVar.RTS rts
|
||||||
|
*--------------------------------------
|
||||||
|
* Input : ZPFileBufPtr, A = Var Type
|
||||||
|
* Output : Value on Stack
|
||||||
|
*--------------------------------------
|
||||||
|
CSH.GetVarValue sta ZPVarType
|
||||||
|
|
||||||
|
.1 >PUSHWI 0
|
||||||
|
>PUSHWI 6
|
||||||
|
>PUSHWI ZPVarData
|
||||||
|
>PUSHWI ZPVarID
|
||||||
|
>LDA.G CSH.hSymbols
|
||||||
|
>SYSCALL SListGetData
|
||||||
|
bcs CSH.GetVar.RTS
|
||||||
|
|
||||||
|
CSH.PushValueOnStack
|
||||||
|
ldx ZPVarType
|
||||||
|
cpx ZPVarData
|
||||||
|
bne .99
|
||||||
|
|
||||||
|
ldy CSH.TSIZE,x
|
||||||
|
|
||||||
|
.2 lda ZPVarData,y
|
||||||
|
>PUSHA
|
||||||
|
dey
|
||||||
|
bne .2
|
||||||
|
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
.99 lda #CSH.E.TMISMATCH
|
||||||
|
sec
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CSH.StoreACCToVar
|
CSH.SetVarValue cmp ZPVarType
|
||||||
>LDA.G CSH.ACCT
|
|
||||||
cmp (ZPCSHValue)
|
|
||||||
bne .9
|
bne .9
|
||||||
|
|
||||||
tax
|
tax
|
||||||
lda CSH.TSIZE,x
|
ldy CSH.TSIZE,x Byte count to transfer
|
||||||
tax Byte count to transfer
|
|
||||||
|
|
||||||
>LEA.G CSH.ACC
|
ldx #1
|
||||||
>STYA ZPPtr1
|
|
||||||
|
|
||||||
ldy #1 do not trash TYPE byte
|
.1 >PULLA
|
||||||
|
sta ZPVarData,x
|
||||||
.1 lda (ZPPtr1)
|
inx
|
||||||
inc ZPPtr1
|
dey
|
||||||
bne .2
|
|
||||||
inc ZPPtr1+1
|
|
||||||
|
|
||||||
.2 sta (ZPCSHValue),y
|
|
||||||
iny
|
|
||||||
dex
|
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@ -842,11 +840,13 @@ CSH.StoreACCToVar
|
|||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CSH.IsACC0 >LDA.G CSH.ACCT
|
CSH.IsValue0 ldx ZPVarType
|
||||||
cmp #CSH.T.FLOAT
|
cpx #CSH.T.FLOAT
|
||||||
bne .1 char,int,long
|
bne .1 char,int,long
|
||||||
|
|
||||||
>LDA.G CSH.ACC
|
ldy CSH.TSIZE,x
|
||||||
|
|
||||||
|
lda ZPVarData,y
|
||||||
bne .9
|
bne .9
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
@ -857,9 +857,9 @@ CSH.IsACC0 >LDA.G CSH.ACCT
|
|||||||
tax
|
tax
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
ldy #CSH.ACC
|
ldy #1
|
||||||
|
|
||||||
.2 ora (pData),y
|
.2 ora ZPVarData,y
|
||||||
iny
|
iny
|
||||||
dex
|
dex
|
||||||
bne .2
|
bne .2
|
||||||
@ -878,7 +878,7 @@ CSH.BOPS.ADD
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
CSH.BOPS.SUB >LDA.G CSH.ACCT
|
CSH.BOPS.SUB lda ZPVarType
|
||||||
cmp #CSH.T.FLOAT
|
cmp #CSH.T.FLOAT
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
@ -888,18 +888,15 @@ CSH.BOPS.SUB >LDA.G CSH.ACCT
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.8 >PUSHF.G CSH.ACC
|
.8 >FPU FSUB
|
||||||
>PUSHF.G CSH.ARG
|
|
||||||
>FPU FSUB
|
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>PULLF.G CSH.ACC
|
|
||||||
.9 rts
|
.9 rts
|
||||||
CSH.BOPS.MUL
|
CSH.BOPS.MUL
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
CSH.BOPS.DIV >LDA.G CSH.ACCT
|
CSH.BOPS.DIV lda ZPVarType
|
||||||
cmp #CSH.T.FLOAT
|
cmp #CSH.T.FLOAT
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
@ -909,10 +906,9 @@ CSH.BOPS.DIV >LDA.G CSH.ACCT
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.8 >PUSHF.G CSH.ACC
|
.8
|
||||||
>PUSHF.G CSH.ARG
|
|
||||||
>FPU FDIV
|
>FPU FDIV
|
||||||
>PULLF.G CSH.ACC
|
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
CSH.BOPS.MOD
|
CSH.BOPS.MOD
|
||||||
@ -1094,28 +1090,24 @@ CSH.IsDigit10 cmp #'0'
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* EXEC
|
* EXEC
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
EXEC.printf >LDYA.G CSH.ACC
|
EXEC.printf >PULLYA
|
||||||
>SYSCALL printf
|
>SYSCALL printf
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>STYA.G CSH.ACC
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
EXEC.puts >LDYA.G CSH.ACC
|
EXEC.puts >PULLYA
|
||||||
>SYSCALL puts
|
>SYSCALL puts
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>STYA.G CSH.ACC
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
EXEC.cos >FPU COS
|
EXEC.cos >FPU COS
|
||||||
|
|
||||||
>PULLF.G CSH.ACC
|
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
EXEC.getchar >SYSCALL getchar
|
EXEC.getchar >SYSCALL getchar
|
||||||
|
|
||||||
>STA.G CSH.ACC
|
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MAN
|
MAN
|
||||||
|
@ -28,7 +28,7 @@ ZPPtr3 .BS 2
|
|||||||
|
|
||||||
ZPVarID .BS 2
|
ZPVarID .BS 2
|
||||||
ZPVarType .BS 1
|
ZPVarType .BS 1
|
||||||
|
ZPVarData .BS 6
|
||||||
|
|
||||||
ZS.END .ED
|
ZS.END .ED
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user