summaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-09-24 08:21:08 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-09-24 08:21:08 -0400
commit784ff59108b887e246b0f33ff696dfd981659ab2 (patch)
tree02d00ff774bd35a31f04afb62a7f187ca0a097f9 /programs
parent9932fac52c0cac2e9e0e11c84dfdf99e0a87ebfb (diff)
- Fixed some more bugs with struct, and union handling.
Diffstat (limited to 'programs')
-rw-r--r--programs/sub-suite/declare.s16
-rw-r--r--programs/sub-suite/lexer.s10
2 files changed, 15 insertions, 11 deletions
diff --git a/programs/sub-suite/declare.s b/programs/sub-suite/declare.s
index cd97b60..183d09d 100644
--- a/programs/sub-suite/declare.s
+++ b/programs/sub-suite/declare.s
@@ -51,8 +51,12 @@
val .qword ; Value of symbol.
- strct .byte ; Flag that says this symbol is a struct, or union.
- def .byte ; Flag that says this symbol has been defined.
+ .union
+ strct .byte ; Bit 0: Struct/Union flag.
+ anon .byte ; Bit 1: Anonymous struct/union flag.
+ def .byte ; Bit 2: Defined symbol flag.
+ flags .byte ; Flags.
+ .endunion
name .qword ; Name of symbol.
id .word ; ID of symbol.
@@ -301,19 +305,19 @@ t_sym:
; Current token.
ctok:
- .res 2
+ .res 8
; Last token.
ltok:
- .res 2
+ .res 8
; Current line.
cline:
- .res 2
+ .res 8
; Last line.
lline:
- .res 2
+ .res 8
; Lexeme type.
lex_type:
diff --git a/programs/sub-suite/lexer.s b/programs/sub-suite/lexer.s
index 72f1db6..50bf21e 100644
--- a/programs/sub-suite/lexer.s
+++ b/programs/sub-suite/lexer.s
@@ -18,15 +18,15 @@ lex:
; jsr isdigit ; Is this character a digit?
; pla ; Get the character back.
@getline:
- lda #2 ; Get the third byte, of the line table address.
- lsl #$10 ; Shift it by 2 bytes.
ldb #1 ; Set the second pointer
- lda.w lline ; to the last line.
+ lda.q lline ; to the last line.
jsr set_ptr ;
- lda.w (ptr2) ; Get the next line.
+ ldy #ln.next ; Set the index to the next line pointer.
+ lda.q (ptr2), y ; Get the next line.
jsr set_ptr ; Set the second pointer to the next line.
- sta.w cline ; Make it the current line.
+ sta.q cline ; Make it the current line.
and #0 ; Reset A.
+ tay ; Reset Y.
@loop:
ldy.w idx0 ; Get the string index.
lda (ptr), y ; Get a character from the line.