Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-07-31 16:46:11 +02:00
parent 4ca0e321ad
commit 6ad471abcc
10 changed files with 173 additions and 149 deletions

Binary file not shown.

View File

@ -25,6 +25,6 @@ CSH.StackPtr .BS 1
CSH.VarDef .BS 6 CSH.VarDef .BS 6
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/CSH.D SAVE usr/src/bin/csh.d
LOAD USR/SRC/BIN/CSH.S LOAD usr/src/bin/csh.s
ASM ASM

View File

@ -18,6 +18,6 @@ CSH.E.OOM .EQ $D2
CSH.E.DUP .EQ $D3 CSH.E.DUP .EQ $D3
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/CSH.E SAVE usr/src/bin/csh.e
LOAD USR/SRC/BIN/CSH.S LOAD usr/src/bin/csh.s
ASM ASM

View File

@ -77,6 +77,7 @@ CSH.BOPS >PSTR "+"
* Reserved Directives: * Reserved Directives:
*-------------------------------------- *--------------------------------------
CSH.DIRS >PSTR "define" CSH.DIRS >PSTR "define"
>PSTR "include"
.HS 00 .HS 00
*-------------------------------------- *--------------------------------------
* Reserved Keywords: * Reserved Keywords:
@ -192,6 +193,6 @@ CSH.FN
.DA #0 .DA #0
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/CSH.I SAVE usr/src/bin/csh.i
LOAD USR/SRC/BIN/CSH.S LOAD usr/src/bin/csh.s
ASM ASM

View File

@ -50,6 +50,7 @@ L.CSH.DIRS .DA CSH.DIRS
L.CSH.KW .DA CSH.KW L.CSH.KW .DA CSH.KW
L.CSH.STYPES .DA CSH.STYPES L.CSH.STYPES .DA CSH.STYPES
J.CSH.DIRS .DA CSH.DIR.DEFINE J.CSH.DIRS .DA CSH.DIR.DEFINE
.DA CSH.DIR.INCLUDE
J.CSH.KW .DA CSH.IF J.CSH.KW .DA CSH.IF
.DA CSH.WHILE .DA CSH.WHILE
.DA CSH.ELSE .DA CSH.ELSE
@ -96,6 +97,6 @@ J.CSH.EXEC .DA EXEC.log
.DA EXEC.malloc .DA EXEC.malloc
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/CSH.R SAVE usr/src/bin/csh.r
LOAD USR/SRC/BIN/CSH.S LOAD usr/src/bin/csh.s
ASM ASM

View File

@ -1,6 +1,6 @@
NEW NEW
AUTO 3,1 AUTO 3,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
CSH.Init >SYSCALL SListNew CSH.Init >SYSCALL SListNew
bcs .9 bcs .9
@ -11,12 +11,12 @@ CSH.Init >SYSCALL SListNew
bcs .9 bcs .9
>STA.G CSH.hTags >STA.G CSH.hTags
>SYSCALL SListNew >SYSCALL SListNew
bcs .9 bcs .9
>STA.G CSH.hSymbols >STA.G CSH.hSymbols
>LDYAI 256 >LDYAI 256
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
@ -54,25 +54,25 @@ CSH.Init >SYSCALL SListNew
*-------------------------------------- *--------------------------------------
CSH.Quit >LDA.G CSH.hSymbols CSH.Quit >LDA.G CSH.hSymbols
beq .1 beq .1
>PUSHA >PUSHA
>SYSCALL SListFree >SYSCALL SListFree
.1 >LDA.G CSH.hTags .1 >LDA.G CSH.hTags
beq .2 beq .2
>PUSHA >PUSHA
>SYSCALL SListFree >SYSCALL SListFree
.2 >LDA.G CSH.hDefines .2 >LDA.G CSH.hDefines
beq .3 beq .3
>PUSHA >PUSHA
>SYSCALL SListFree >SYSCALL SListFree
.3 lda ZPhMacro .3 lda ZPhMacro
jsr .7 jsr .7
>LDA.G hFileBuf >LDA.G hFileBuf
jsr .7 jsr .7
@ -83,7 +83,7 @@ CSH.Quit >LDA.G CSH.hSymbols
jsr .7 jsr .7
>LDA.G CSH.hConst >LDA.G CSH.hConst
.7 beq CSH.Quit.RTS .7 beq CSH.Quit.RTS
>SYSCALL FreeMem >SYSCALL FreeMem
CSH.Quit.RTS rts CSH.Quit.RTS rts
@ -93,7 +93,7 @@ CSH.Run jsr CSH.GetCharNB
CSH.Run.1 cmp #C.CR empty line.... CSH.Run.1 cmp #C.CR empty line....
beq .2 beq .2
cmp #'/' cmp #'/'
bne .3 comments ... bne .3 comments ...
@ -139,7 +139,7 @@ CSH.Run.1 cmp #C.CR empty line....
>STYA ZPVarID >STYA ZPVarID
jsr CSH.GetVarDef Get Type & ptr... jsr CSH.GetVarDef Get Type & ptr...
bcs .9 bcs .9
jsr CSH.GetCharNB jsr CSH.GetCharNB
bcs .9 bcs .9
@ -180,7 +180,7 @@ CSH.Run.1 cmp #C.CR empty line....
beq .80 beq .80
jmp CSH.Run.1 jmp CSH.Run.1
.80 jmp CSH.GetNextChar Skip CR .80 jmp CSH.GetNextChar Skip CR
*-------------------------------------- *--------------------------------------
CSH.COMMENTS jsr CSH.GetNextChar CSH.COMMENTS jsr CSH.GetNextChar
@ -188,74 +188,100 @@ CSH.COMMENTS jsr CSH.GetNextChar
bne .90 bne .90
jmp CSH.SkipLine skip line..... jmp CSH.SkipLine skip line.....
.90 lda #CSH.E.SYNTAX .90 lda #CSH.E.SYNTAX
sec sec
rts rts
*-------------------------------------- *--------------------------------------
CSH.DIR jsr CSH.GetNextCharNB CSH.DIR jsr CSH.GetNextCharNB
bcs .99 bcs .99
cmp #'!' #!/bin/csh cmp #'!' #!/bin/csh
bne .1 bne .1
bra CSH.SkipLine jmp CSH.SkipLine
.1 >LDYA L.CSH.DIRS .1 >LDYA L.CSH.DIRS
jsr CSH.LookupID jsr CSH.LookupID
bcs .91 bcs .91
jmp (J.CSH.DIRS,x) jmp (J.CSH.DIRS,x)
.91 lda #CSH.E.INVDIR .91 lda #CSH.E.INVDIR
sec sec
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
CSH.DIR.DEFINE jsr CSH.CheckSpace CSH.DIR.DEFINE jsr CSH.CheckSpace
bcs .99 bcs .99
jsr CSH.IsLetter jsr CSH.IsLetter
bcs .90 bcs .90
>LDA.G CSH.hDefines >LDA.G CSH.hDefines
jsr CSH.NewKey jsr CSH.NewKey
bcs .99 bcs .99
>STYA ZPVarID >STYA ZPVarID
jsr CSH.CheckSpace jsr CSH.CheckSpace
bcs .99 bcs .99
ldy #$ff ldy #$ff
.1 iny .1 iny
lda (ZPFileBufPtr),y lda (ZPFileBufPtr),y
beq .2 beq .2
cmp #C.CR cmp #C.CR
bne .1 bne .1
dey dey
.2 iny .2 iny
lda #0 lda #0
pha pha
phy phy
>PUSHB.G CSH.hDefines >PUSHB.G CSH.hDefines
>PUSHW ZPVarID >PUSHW ZPVarID
>PUSHW ZPFileBufPtr >PUSHW ZPFileBufPtr
ply ply
pla pla
>PUSHYA DataLen >PUSHYA DataLen
>SYSCALL SListAddData >SYSCALL SListAddData
bcs .99 bcs .99
bra CSH.SkipLine bra CSH.SkipLine
.90 lda #CSH.E.SYNTAX
sec
.99 rts
*--------------------------------------
CSH.DIR.INCLUDE jsr CSH.CheckSpace
bcs .99
cmp #'"'
beq .1
cmp #'<'
bne .80
lda #'>'
.1 sta ArgIndex
bra CSH.SkipLine
.90 lda #CSH.E.SYNTAX .90 lda #CSH.E.SYNTAX
sec sec
.99 rts .99 rts
@ -270,7 +296,7 @@ CSH.SkipLine jsr CSH.GetNextChar
*-------------------------------------- *--------------------------------------
* Built in Keywords * Built in Keywords
*-------------------------------------- *--------------------------------------
CSH.KW.JMP txa CSH.KW.JMP txa
>STA.G CSH.CmdSave >STA.G CSH.CmdSave
jmp (J.CSH.KW,x) jmp (J.CSH.KW,x)
*-------------------------------------- *--------------------------------------
@ -295,7 +321,7 @@ CSH.IF jsr CSH.GetCharNB
bne .9 bne .9
jsr CSH.GetNextCharNB Skip '{' jsr CSH.GetNextCharNB Skip '{'
bcs .99 bcs .99
jsr CSH.IsValue0 X = var type from ExpEval jsr CSH.IsValue0 X = var type from ExpEval
bcc .6 Value=0, skip {{....}} bcc .6 Value=0, skip {{....}}
@ -306,14 +332,14 @@ CSH.IF jsr CSH.GetCharNB
>LDA.G CSH.BufPtrSave+1 WHILE : push loop address... >LDA.G CSH.BufPtrSave+1 WHILE : push loop address...
jsr CSH.Push jsr CSH.Push
>LDA.G CSH.BufPtrSave >LDA.G CSH.BufPtrSave
jsr CSH.Push jsr CSH.Push
pla pla
.1 jsr CSH.Push .1 jsr CSH.Push
bcs .99 bcs .99
lda #'}' Tell '}' is expected at the end of block lda #'}' Tell '}' is expected at the end of block
jsr CSH.Push jsr CSH.Push
bcs .99 bcs .99
rts rts
.6 jsr CSH.SkipBlock .6 jsr CSH.SkipBlock
@ -333,7 +359,7 @@ CSH.IF jsr CSH.GetCharNB
* >LDA.G CSH.BufPtrSave+1 WHILE : push loop address... * >LDA.G CSH.BufPtrSave+1 WHILE : push loop address...
* jsr CSH.Push * jsr CSH.Push
* >LDA.G CSH.BufPtrSave * >LDA.G CSH.BufPtrSave
* jsr CSH.Push * jsr CSH.Push
* pla * pla
* jmp CSH.Push Push "WHILE" Token * jmp CSH.Push Push "WHILE" Token
*-------------------------------------- *--------------------------------------
@ -365,29 +391,29 @@ CSH.STRUCT >ENTER 4
jsr CSH.GetCharNB jsr CSH.GetCharNB
bcs .99 bcs .99
>LDA.G CSH.hTags >LDA.G CSH.hTags
jsr CSH.NewKey jsr CSH.NewKey
bcs .99 bcs .99
sta (pStack) sta (pStack)
jsr CSH.GetNextCharNB jsr CSH.GetNextCharNB
bcs .99 bcs .99
cmp #'{' cmp #'{'
bne .99 bne .99
.1 jsr CSH.GetNextCharNB .1 jsr CSH.GetNextCharNB
bcs .99 bcs .99
cmp #'}' cmp #'}'
bne .1 bne .1
jsr CSH.GetNextCharNB skip } jsr CSH.GetNextCharNB skip }
clc clc
.99 >LEAVE .99 >LEAVE
rts rts
*-------------------------------------- *--------------------------------------
* Built in Types * Built in Types
*-------------------------------------- *--------------------------------------
@ -396,25 +422,25 @@ CSH.SIGNED sec
*-------------------------------------- *--------------------------------------
CSH.UNSIGNED clc CSH.UNSIGNED clc
php php
jsr CSH.CheckSpace jsr CSH.CheckSpace
bcs .9 bcs .9
>LDYA L.CSH.STYPES >LDYA L.CSH.STYPES
jsr CSH.LookupID jsr CSH.LookupID
bcs .9 bcs .9
plp plp
bcs .8 bcs .8
jmp (J.CSH.UTYPES,x) jmp (J.CSH.UTYPES,x)
.8 jmp (J.CSH.STYPES,x) .8 jmp (J.CSH.STYPES,x)
.9 plp .9 plp
lda #CSH.E.SYNTAX lda #CSH.E.SYNTAX
sec sec
rts rts
*-------------------------------------- *--------------------------------------
CSH.VOID ldx #CSH.T.VOID CSH.VOID ldx #CSH.T.VOID
bra CSH.TYPE bra CSH.TYPE
@ -436,15 +462,15 @@ CSH.FLOAT ldx #CSH.T.FLOAT
CSH.TYPE stx ZPVarType CSH.TYPE stx ZPVarType
jsr CSH.CheckSpace jsr CSH.CheckSpace
bcs .9 bcs .9
.11 cmp #'*' .11 cmp #'*'
bne .10 bne .10
lda #CSH.Q.POINTER lda #CSH.Q.POINTER
tsb ZPVarType tsb ZPVarType
jsr CSH.GetNextCharNB Skip * jsr CSH.GetNextCharNB Skip *
bra .11 bra .11
.10 jsr CSH.IsLetter .10 jsr CSH.IsLetter
bcs .9 bcs .9
@ -465,13 +491,13 @@ CSH.TYPE stx ZPVarType
lda ZPVarType lda ZPVarType
jsr CSH.ExpEval jsr CSH.ExpEval
bcs .99 bcs .99
.7 jsr CSH.SetVarValueFromStack X= Type, Set value to this var .7 jsr CSH.SetVarValueFromStack X= Type, Set value to this var
bcs .99 bcs .99
jsr CSH.GetChar jsr CSH.GetChar
bcs .9 bcs .9
cmp #';' cmp #';'
bne .9 bne .9
@ -482,7 +508,7 @@ CSH.TYPE stx ZPVarType
sec sec
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
* Input: * Input:
* ZPFileBufPtr, A = Expected type * ZPFileBufPtr, A = Expected type
* Output: * Output:
* CS, A = EC * CS, A = EC
@ -609,10 +635,9 @@ CSH.fCall ldx ZPPtr1
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
CSH.fCall.Exec CSH.fCall.Exec jmp (J.CSH.EXEC,x)
jmp (J.CSH.EXEC,x)
*-------------------------------------- *--------------------------------------
* Input: * Input:
* ZPFileBufPtr, A = Expected type * ZPFileBufPtr, A = Expected type
* Output: * Output:
* CS, A = EC * CS, A = EC
@ -637,21 +662,21 @@ CSH.ExpEval ldx ZPPtr1
.11 cmp #'(' .11 cmp #'('
bne .20 bne .20
jsr CSH.GetNextCharNB skip ( jsr CSH.GetNextCharNB skip (
bcs .19 bcs .19
lda ZPPtr2 lda ZPPtr2
jsr CSH.ExpEval jsr CSH.ExpEval
bcs .19 bcs .19
stx ZPPtr2 stx ZPPtr2
jsr CSH.GetCharNB jsr CSH.GetCharNB
bcs .19 bcs .19
cmp #')' cmp #')'
bne .19 bne .19
jsr CSH.GetNextCharNB skip ) jsr CSH.GetNextCharNB skip )
bcc .31 bcc .31
.19 jmp .90 .19 jmp .90
@ -661,7 +686,7 @@ CSH.ExpEval ldx ZPPtr1
jsr CSH.GetDefine jsr CSH.GetDefine
bcc .10 bcc .10
jsr CSH.GetVar jsr CSH.GetVar
bcs .21 bcs .21
@ -692,7 +717,7 @@ CSH.ExpEval ldx ZPPtr1
.23 jsr CSH.GetNumOnStack .23 jsr CSH.GetNumOnStack
bcs .29 bcs .29
bra .30 bra .30
.24 cmp #'"' String literal .24 cmp #'"' String literal
bne .90 bne .90
jsr CSH.AddContCharP jsr CSH.AddContCharP
@ -714,28 +739,28 @@ CSH.ExpEval ldx ZPPtr1
>LDYA L.CSH.BOPS we are at V1 op1 V2 op2... >LDYA L.CSH.BOPS we are at V1 op1 V2 op2...
jsr CSH.LookupOP jsr CSH.LookupOP
bcs .90 bcs .90
stx ZPPtr2+1 save OP(n) stx ZPPtr2+1 save OP(n)
.32 pla get OP(n-1) .32 pla get OP(n-1)
bmi .33 $ff.... bmi .33 $ff....
cmp ZPPtr2+1 cmp ZPPtr2+1
bcc .33 OP(n) has precedence, on stack : V1,V2 bcc .33 OP(n) has precedence, on stack : V1,V2
tax OP(n-1) has precedence... tax OP(n-1) has precedence...
lda ZPPtr2 Var Type lda ZPPtr2 Var Type
jsr CSH.BOP.EXEC compute V(n-1) <OP(n-1)> V(n) jsr CSH.BOP.EXEC compute V(n-1) <OP(n-1)> V(n)
bcc .32 bcc .32
bcs .99 bcs .99
.33 pha push back OP(n-1) .33 pha push back OP(n-1)
lda ZPPtr2+1 get OP(n) lda ZPPtr2+1 get OP(n)
pha push OP(n) on stack pha push OP(n) on stack
jmp .10 go check for next token jmp .10 go check for next token
*-------------------------------------- *--------------------------------------
.80 plx any OP on stack ? .80 plx any OP on stack ?
bmi .88 bmi .88
@ -743,14 +768,14 @@ CSH.ExpEval ldx ZPPtr1
lda ZPPtr2 Var Type lda ZPPtr2 Var Type
jsr CSH.BOP.EXEC jsr CSH.BOP.EXEC
bcc .80 bcc .80
bcs .99 bcs .99
.90 lda #CSH.E.SYNTAX .90 lda #CSH.E.SYNTAX
.99 plx .99 plx
bpl .99 bpl .99
sec sec
.HS 90 BCC .HS 90 BCC
.88 clc .88 clc
@ -777,9 +802,9 @@ CSH.AddContCharP
cmp #'"' cmp #'"'
beq .2 beq .2
sta (ZPCSHConst),y sta (ZPCSHConst),y
iny iny
bra .1 bra .1
.2 lda #0 .2 lda #0
sta (ZPCSHConst),y sta (ZPCSHConst),y
>PUSHW ZPCSHConst Push PTR on stack >PUSHW ZPCSHConst Push PTR on stack
@ -854,17 +879,17 @@ CSH.Lookup phy Y = len
jsr CSH.ZPPtr1AddAp1 jsr CSH.ZPPtr1AddAp1
>LDA.G CSH.LookupOpt >LDA.G CSH.LookupOpt
bpl .1 bpl .1
ldy #$0 Start at Y=1 for VOID func() ldy #$0 Start at Y=1 for VOID func()
.6 iny .6 iny
lda (ZPPtr1),y lda (ZPPtr1),y
bne .6 bne .6
tya tya
jsr CSH.ZPPtr1AddAp1 jsr CSH.ZPPtr1AddAp1
bra .1 bra .1
.9 pla .9 pla
sec sec
rts rts
@ -872,11 +897,11 @@ CSH.Lookup phy Y = len
CSH.ZPPtr1Next inc ZPPtr1 CSH.ZPPtr1Next inc ZPPtr1
bne .8 bne .8
inc ZPPtr1+1 inc ZPPtr1+1
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
CSH.ZPPtr1AddAp1 CSH.ZPPtr1AddAp1
sec sec
adc ZPPtr1 adc ZPPtr1
sta ZPPtr1 sta ZPPtr1
bcc .1 bcc .1
inc ZPPtr1+1 inc ZPPtr1+1
@ -946,35 +971,35 @@ CSH.AddVar >LDA.G CSH.hSymbols
ldx ZPVarType ldx ZPVarType
jsr CSH.GetVarSize jsr CSH.GetVarSize
sta ZPVarSizeOf sta ZPVarSizeOf
lda ZPCSHData lda ZPCSHData
sta ZPVarDataPtr sta ZPVarDataPtr
clc clc
adc ZPVarSizeOf adc ZPVarSizeOf
sta ZPCSHData sta ZPCSHData
lda ZPCSHData+1 lda ZPCSHData+1
sta ZPVarDataPtr+1 sta ZPVarDataPtr+1
adc ZPVarSizeOf+1 adc ZPVarSizeOf+1
sta ZPCSHData+1 sta ZPCSHData+1
>LDA.G CSH.DataPtr >LDA.G CSH.DataPtr
clc clc
adc ZPVarSizeOf adc ZPVarSizeOf
sta (pData),y sta (pData),y
bcs .99 bcs .99
>PUSHB.G CSH.hSymbols >PUSHB.G CSH.hSymbols
>PUSHW ZPVarID >PUSHW ZPVarID
>PUSHWI ZPVarDef >PUSHWI ZPVarDef
>PUSHWI 6 >PUSHWI 6
>SYSCALL SListAddData >SYSCALL SListAddData
* bcs .9 * bcs .9
* lda #'*' * lda #'*'
* jsr DEBUG.VAR * jsr DEBUG.VAR
.9 rts .9 rts
.99 lda #CSH.E.OOM .99 lda #CSH.E.OOM
@ -994,9 +1019,9 @@ CSH.NewKey >PUSHA
adc ZPFileBufPtr adc ZPFileBufPtr
sta ZPFileBufPtr sta ZPFileBufPtr
bcc .1 bcc .1
inc ZPFileBufPtr+1 inc ZPFileBufPtr+1
.1 clc .1 clc
pla pla
.9 rts .9 rts
@ -1008,19 +1033,19 @@ CSH.SetVarValueFromStack
bne .99 bne .99
ldy #0 ldy #0
.1 lda (pStack) .1 lda (pStack)
sta (ZPVarDataPtr),y sta (ZPVarDataPtr),y
inc pStack inc pStack
iny iny
cpy ZPVarSizeOf cpy ZPVarSizeOf
bne .1 bne .1
* lda #'>' * lda #'>'
* jsr DEBUG.VAR * jsr DEBUG.VAR
clc clc
rts rts
.99 lda #CSH.E.TMISMATCH .99 lda #CSH.E.TMISMATCH
sec sec
rts rts
@ -1029,7 +1054,7 @@ CSH.GetDefine >PUSHB.G CSH.hDefines
jsr CSH.Get jsr CSH.Get
bcs .9 bcs .9
pha pha
phy phy
>PUSHB.G CSH.hDefines >PUSHB.G CSH.hDefines
@ -1041,23 +1066,23 @@ CSH.GetDefine >PUSHB.G CSH.hDefines
>PUSHWZ len = 0 (string mode) >PUSHWZ len = 0 (string mode)
>PUSHWZ From Start >PUSHWZ From Start
>SYSCALL SListGetData >SYSCALL SListGetData
bcs .9 bcs .9
stx ZPhMacro stx ZPhMacro
lda ZPFileBufPtr lda ZPFileBufPtr
sta ZPFileBufPtrBak sta ZPFileBufPtrBak
lda ZPFileBufPtr+1 lda ZPFileBufPtr+1
sta ZPFileBufPtrBak+1 sta ZPFileBufPtrBak+1
txa txa
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA ZPFileBufPtr >STYA ZPFileBufPtr
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CSH.GetVar >PUSHB.G CSH.hSymbols CSH.GetVar >PUSHB.G CSH.hSymbols
CSH.Get >PUSHW ZPFileBufPtr CSH.Get >PUSHW ZPFileBufPtr
>SYSCALL SListLookup >SYSCALL SListLookup
bcs .9 bcs .9
@ -1077,7 +1102,7 @@ CSH.Get >PUSHW ZPFileBufPtr
CSH.GetVarDef phy CSH.GetVarDef phy
pha pha
>PUSHB.G CSH.hSymbols >PUSHB.G CSH.hSymbols
pla pla
>PUSHA >PUSHA
pla pla
@ -1099,7 +1124,7 @@ CSH.GetVarValueOnStack
phy phy
pha pha
>PUSHB.G CSH.hSymbols >PUSHB.G CSH.hSymbols
pla pla
>PUSHA >PUSHA
pla pla
@ -1115,17 +1140,17 @@ CSH.GetVarValueOnStack
txa txa
beq .1 any type beq .1 any type
>CMP.G CSH.VarDef Type >CMP.G CSH.VarDef Type
beq .2 beq .2
and #CSH.Q.PPPOINTER and #CSH.Q.PPPOINTER
beq .99 not pointer....mismatch beq .99 not pointer....mismatch
>EOR.G CSH.VarDef >EOR.G CSH.VarDef
and #CSH.Q.PPPOINTER and #CSH.Q.PPPOINTER
bne .99 compare only pointer depth bne .99 compare only pointer depth
.1 >LDA.G CSH.VarDef .1 >LDA.G CSH.VarDef
beq * beq *
@ -1138,9 +1163,9 @@ CSH.GetVarValueOnStack
iny iny
lda (pData),y lda (pData),y
sta ZPPtr3+1 sta ZPPtr3+1
ply ply
.3 dey .3 dey
lda (ZPPtr3),y lda (ZPPtr3),y
>PUSHA >PUSHA
@ -1165,10 +1190,10 @@ CSH.IsValue0 cpx #CSH.T.FLOAT
ldy CSH.TYPESIZE,x ldy CSH.TYPESIZE,x
lda (ZPVarDataPtr),y lda (ZPVarDataPtr),y
bne .9 bne .9
.8 clc .8 clc
rts rts
.1 jsr CSH.GetVarSize .1 jsr CSH.GetVarSize
tax tax
@ -1178,10 +1203,10 @@ CSH.IsValue0 cpx #CSH.T.FLOAT
inc pStack inc pStack
dex dex
bne .2 bne .2
tax tax
beq .8 beq .8
.9 sec .9 sec
rts rts
*-------------------------------------- *--------------------------------------
@ -1198,7 +1223,7 @@ CSH.CheckStack tax
clc clc
rts rts
.9 lda #CSH.E.SYNTAX .9 lda #CSH.E.SYNTAX
sec sec
rts rts
@ -1213,7 +1238,7 @@ CSH.Push pha
sta (ZPCSHStack),y sta (ZPCSHStack),y
clc clc
rts rts
.9 pla .9 pla
lda #CSH.E.SOVERFLW lda #CSH.E.SOVERFLW
sec sec
@ -1221,7 +1246,7 @@ CSH.Push pha
*-------------------------------------- *--------------------------------------
CSH.Pop >LDA.G CSH.StackPtr CSH.Pop >LDA.G CSH.StackPtr
beq .9 beq .9
pha pha
inc inc
sta (pData),y sta (pData),y
ply ply
@ -1294,7 +1319,7 @@ CSH.SkipBlock ldy #0 not in "", TOTO:skip comments
CSH.GetCharNB jsr CSH.GetChar CSH.GetCharNB jsr CSH.GetChar
bcs CSH.GetNextCharNB.RTS bcs CSH.GetNextCharNB.RTS
jsr CSH.CheckCharNB jsr CSH.CheckCharNB
bcc CSH.GetNextCharNB.RTS bcc CSH.GetNextCharNB.RTS
*-------------------------------------- *--------------------------------------
CSH.GetNextCharNB CSH.GetNextCharNB
jsr CSH.GetNextChar jsr CSH.GetNextChar
@ -1311,7 +1336,7 @@ CSH.CheckSpace jsr CSH.GetChar
jsr CSH.GetNextCharNB jsr CSH.GetNextCharNB
bcc CSH.GetNextCharNB.RTS bcc CSH.GetNextCharNB.RTS
.90 lda #CSH.E.SYNTAX .90 lda #CSH.E.SYNTAX
sec sec
rts rts
@ -1334,9 +1359,9 @@ CSH.GetChar lda (ZPFileBufPtr)
lda ZPhMacro lda ZPhMacro
beq .9 beq .9
stz ZPhMacro stz ZPhMacro
phx phx
phy phy
>SYSCALL FreeMem >SYSCALL FreeMem
@ -1345,7 +1370,7 @@ CSH.GetChar lda (ZPFileBufPtr)
lda ZPFileBufPtrBak lda ZPFileBufPtrBak
sta ZPFileBufPtr sta ZPFileBufPtr
lda ZPFileBufPtrBak+1 lda ZPFileBufPtrBak+1
sta ZPFileBufPtr+1 sta ZPFileBufPtr+1
@ -1402,7 +1427,7 @@ CSH.IsDigit10 cmp #'0'
CSH.GetVarSize txa CSH.GetVarSize txa
and #CSH.Q.PPPOINTER and #CSH.Q.PPPOINTER
bne .2 bne .2
txa txa
and #$f and #$f
phx phx
@ -1429,6 +1454,6 @@ DEBUG.VAR >SYSCALL PutChar
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/CSH.S.CORE SAVE usr/src/bin/csh.s.core
LOAD USR/SRC/BIN/CSH.S LOAD usr/src/bin/csh.s
ASM ASM

View File

@ -275,6 +275,6 @@ EXEC.malloc >PULLYA
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/CSH.S.EXEC SAVE usr/src/bin/csh.s.exec
LOAD USR/SRC/BIN/CSH.S LOAD usr/src/bin/csh.s
ASM ASM

View File

@ -5,12 +5,12 @@ NEW
.OR $2000 .OR $2000
.TF bin/csh .TF bin/csh
*-------------------------------------- *--------------------------------------
.INB INC/MACROS.I .INB inc/macros.i
.INB INC/A2OSX.I .INB inc/a2osx.i
.INB INC/MLI.I .INB inc/mli.i
.INB INC/MLI.E.I .INB inc/mli.e.i
*-------------------------------------- *--------------------------------------
.INB USR/SRC/BIN/CSH.E .INB usr/src/bin/csh.e
*-------------------------------------- *--------------------------------------
* Zero Page Segment, up to 32 bytes * Zero Page Segment, up to 32 bytes
*-------------------------------------- *--------------------------------------
@ -21,25 +21,22 @@ ZPFileBuf .BS 2
ZPFileBufPtr .BS 2 ZPFileBufPtr .BS 2
ZPFileBufPtrBak .BS 2 ZPFileBufPtrBak .BS 2
ZPCSHConst .BS 2 ZPCSHConst .BS 2
ZPCSHData .BS 2 ZPCSHData .BS 2
ZPCSHStack .BS 2 ZPCSHStack .BS 2
ZPVarID .BS 2
ZPVarID .BS 2
ZPVarDef .EQ * ZPVarDef .EQ *
ZPVarType .BS 2 ZPVarType .BS 2
ZPVarSizeOf .BS 2 ZPVarSizeOf .BS 2
ZPVarDataPtr .BS 2 ZPVarDataPtr .BS 2
ZPhMacro .BS 1 ZPhMacro .BS 1
ArgIndex .BS 1
ZPPtr1 .BS 2 ZPPtr1 .BS 2
ZPPtr2 .BS 2 ZPPtr2 .BS 2
ArgIndex .BS 1
ZPPtr3 .BS 2 ZPPtr3 .BS 2
ZS.END .ED ZS.END .ED
@ -70,7 +67,7 @@ L.MSG.ECHOCRLF .DA MSG.ECHOCRLF
L.MSG.DEBUG .DA MSG.DEBUG L.MSG.DEBUG .DA MSG.DEBUG
L.MSG.ERR .DA MSG.ERR L.MSG.ERR .DA MSG.ERR
L.MSG.DBGVAR .DA MSG.DBGVAR L.MSG.DBGVAR .DA MSG.DBGVAR
.INB USR/SRC/BIN/CSH.R .INB usr/src/bin/csh.r
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
* Called once at process creation * Called once at process creation
@ -295,8 +292,8 @@ PrintTraceMsg.3 >PUSHBI '>'
rts rts
*-------------------------------------- *--------------------------------------
.INB USR/SRC/BIN/CSH.S.CORE .INB usr/src/bin/csh.s.core
.INB USR/SRC/BIN/CSH.S.EXEC .INB usr/src/bin/csh.s.exec
*-------------------------------------- *--------------------------------------
CS.END CS.END
*-------------------------------------- *--------------------------------------
@ -314,16 +311,16 @@ MSG.DBGVAR .AZ "K=%H, T=%H, S=%H, P=%H, V=%L\r\n"
OptionList .AS "DdTt" OptionList .AS "DdTt"
OptionVars .DA #bDebug,#bDebug,#bTrace,#bTrace OptionVars .DA #bDebug,#bDebug,#bTrace,#bTrace
*-------------------------------------- *--------------------------------------
.INB USR/SRC/BIN/CSH.I .INB usr/src/bin/csh.i
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR 0 .OR 0
DS.START .INB USR/SRC/BIN/CSH.D DS.START .INB usr/src/bin/csh.d
bDebug .BS 1 bDebug .BS 1
bTrace .BS 1 bTrace .BS 1
DS.END DS.END
.ED .ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/CSH.S SAVE usr/src/bin/csh.s
ASM ASM

View File

@ -353,7 +353,7 @@ OPEN.I jsr CLOSE
rts rts
*-------------------------------------- *--------------------------------------
OPEN.SnY >AR.Sn.SELECT S0.MR OPEN.SnY >AR.Sn.SELECT S0.MR
lda #W5100.AR.Sn.MR.IPRAW+W5100.AR.Sn.MR.MF lda #W5100.AR.Sn.MR.IPRAW
sta W5100.DR,x sta W5100.DR,x
>AR.Sn.SELECT S0.PROTO >AR.Sn.SELECT S0.PROTO

View File

@ -12,4 +12,4 @@ NEW
short int fopen ( const char *, short int, short int, int ); short int fopen ( const char *, short int, short int, int );
MAN MAN
SAVE include/A2osX.h TEXT include/A2osX.h