diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index a1f8d004..74b432a5 100644 Binary files a/.Floppies/A2OSX.BUILD.po and b/.Floppies/A2OSX.BUILD.po differ diff --git a/BIN/CSH.D.txt b/BIN/CSH.D.txt index c582f9a3..f9ac1ef4 100644 --- a/BIN/CSH.D.txt +++ b/BIN/CSH.D.txt @@ -10,6 +10,7 @@ CSH.LookupOpt .BS 1 CSH.hDefines .BS 1 CSH.hSymbols .BS 1 +CSH.hTags .BS 1 CSH.hConst .BS 1 CSH.ConstPtr .BS 2 diff --git a/BIN/CSH.I.txt b/BIN/CSH.I.txt index 21931ab2..77d30150 100644 --- a/BIN/CSH.I.txt +++ b/BIN/CSH.I.txt @@ -90,6 +90,9 @@ CSH.KW >PSTR "if" >PSTR "case" >PSTR "break" >PSTR "continue" + >PSTR "typedef" + >PSTR "struct" + >PSTR "sizeof" >PSTR "void" >PSTR "float" >PSTR "signed" char,int,long diff --git a/BIN/CSH.R.txt b/BIN/CSH.R.txt index 2442460f..2de398b6 100644 --- a/BIN/CSH.R.txt +++ b/BIN/CSH.R.txt @@ -59,6 +59,9 @@ J.CSH.KW .DA CSH.IF .DA CSH.CASE .DA CSH.BREAK .DA CSH.CONTINUE + .DA CSH.TYPEDEF + .DA CSH.STRUCT + .DA CSH.SIZEOF .DA CSH.VOID .DA CSH.FLOAT .DA CSH.SIGNED diff --git a/BIN/CSH.S.CORE.txt b/BIN/CSH.S.CORE.txt index 912483be..b000acb9 100644 --- a/BIN/CSH.S.CORE.txt +++ b/BIN/CSH.S.CORE.txt @@ -5,13 +5,18 @@ NEW CSH.Init >SYSCALL SListNew bcs .9 - >STA.G CSH.hSymbols + >STA.G CSH.hDefines >SYSCALL SListNew bcs .9 - >STA.G CSH.hDefines + >STA.G CSH.hTags + + >SYSCALL SListNew + bcs .9 + >STA.G CSH.hSymbols + >LDYAI 256 >SYSCALL GetMem bcs .9 @@ -53,13 +58,19 @@ CSH.Quit >LDA.G CSH.hSymbols >PUSHA >SYSCALL SListFree -.1 >LDA.G CSH.hDefines +.1 >LDA.G CSH.hTags beq .2 >PUSHA >SYSCALL SListFree -.2 lda ZPhMacro +.2 >LDA.G CSH.hDefines + beq .3 + + >PUSHA + >SYSCALL SListFree + +.3 lda ZPhMacro jsr .7 >LDA.G hFileBuf @@ -157,7 +168,7 @@ CSH.Run.1 cmp #C.CR empty line.... jsr CSH.fCall bcs .9 - jsr CSH.SIZEOF X = returned value type + jsr CSH.GetVarSize X = returned value type clc A = Sizeof adc pStack sta pStack Discard value on stack @@ -252,10 +263,9 @@ CSH.SkipLine jsr CSH.GetNextChar bcs .9 cmp #C.CR bne CSH.SkipLine - + clc - -.9 rts +.9 rts *-------------------------------------- * Built in Keywords *-------------------------------------- @@ -344,11 +354,34 @@ CSH.SWITCH CSH.CASE CSH.BREAK CSH.CONTINUE - +CSH.TYPEDEF +CSH.SIZEOF lda #CSH.E.SYNTAX sec rts *-------------------------------------- +CSH.STRUCT jsr CSH.GetCharNB + bcs .99 + + >LDA.G CSH.hTags + jsr CSH.NewKey + bcs .99 + + jsr CSH.GetNextCharNB + bcs .99 + cmp #'{' + bne .99 + +.1 jsr CSH.GetNextCharNB + bcs .99 + cmp #'}' + bne .1 + + jsr CSH.GetNextCharNB skip } + + clc +.99 rts +*-------------------------------------- * Built in Types *-------------------------------------- CSH.SIGNED sec @@ -498,7 +531,7 @@ CSH.fCall ldx ZPPtr1 lda (ZPPtr1) get current arg type eor #CSH.T.VARIADIC bne .5 - jsr CSH.SIZEOF X = Var Type + jsr CSH.GetVarSize X = Var Type * clc adc ZPPtr2+1 @@ -909,7 +942,7 @@ CSH.AddVar >LDA.G CSH.hSymbols >STYA ZPVarID ldx ZPVarType - jsr CSH.SizeOf + jsr CSH.GetVarSize sta ZPVarSizeOf lda ZPCSHData @@ -1095,7 +1128,7 @@ CSH.GetVarValueOnStack beq * .2 tax - jsr CSH.SIZEOF + jsr CSH.GetVarSize pha >LDA.G CSH.VarDef+4 @@ -1134,7 +1167,7 @@ CSH.IsValue0 cpx #CSH.T.FLOAT .8 clc rts -.1 jsr CSH.SIZEOF +.1 jsr CSH.GetVarSize tax lda #0 @@ -1364,7 +1397,7 @@ CSH.IsDigit10 cmp #'0' *-------------------------------------- * in : X = type, out : X = type, A = size *-------------------------------------- -CSH.SIZEOF txa +CSH.GetVarSize txa and #CSH.Q.PPPOINTER bne .2 @@ -1380,22 +1413,17 @@ CSH.SIZEOF txa rts *-------------------------------------- DEBUG.VAR >SYSCALL putchar - >PUSHW L.MSG.DBGVAR >PUSHW ZPVarID >PUSHW ZPVarType >PUSHW ZPVarSizeOf >PUSHW ZPVarDataPtr - ldy #3 - .1 >PUSHB (ZPVarDataPtr),y dey bpl .1 - >PUSHBI 12 >SYSCALL printf -* >DEBUG rts *-------------------------------------- MAN