summaryrefslogtreecommitdiff
path: root/programs/sub-suite/declare.s
diff options
context:
space:
mode:
Diffstat (limited to 'programs/sub-suite/declare.s')
-rw-r--r--programs/sub-suite/declare.s81
1 files changed, 74 insertions, 7 deletions
diff --git a/programs/sub-suite/declare.s b/programs/sub-suite/declare.s
index 166197b..cd97b60 100644
--- a/programs/sub-suite/declare.s
+++ b/programs/sub-suite/declare.s
@@ -1,4 +1,70 @@
+; Structs, and unions.
+
+; Line struct.
+.struct ln
+ next .qword ; Pointer to next line.
+ tok .qword ; The tokens for this line.
+
+ bline .word ; Number of blank lines.
+ lnum .dword ; Line number.
+
+ addr .qword ; The address of this line.
+.endstruct
+
+; Token struct.
+.struct tok
+ ;ptype .byte ; Pointer type, 0 for token, -1 for end of token.
+ next .qword ; Pointer to next token.
+ id .byte ; Token ID.
+ type .byte ; Token type ID.
+
+ tabs .byte ; Number of tabs.
+ spaces .byte ; Number of spaces.
+ stab .byte ; Number of sub-token tabs.
+ sspace .byte ; Number of sub-token spaces.
+ digits .byte ; Number of digits.
+
+ .union ; Token value.
+ sym .qword ; Symbol.
+ str .qword ; String.
+ val .qword ; Value.
+ .endunion
+.endstruct
+
+; Fixup struct.
+.struct fix
+ next .qword ; Pointer to next fixup.
+
+ s .qword ; Unresolved symbol.
+ t .qword ; Token that used the unresolved symbol.
+
+ addr .qword ; Address of where it happened.
+.endstruct
+
+; Symbol struct.
+.struct sym
+ next .qword ; Pointer to next symbol.
+ prev .qword ; Pointer to previous symbol.
+ down .qword ; Pointer to child symbol.
+ up .qword ; Pointer to parent symbol.
+
+ 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.
+
+ name .qword ; Name of symbol.
+ id .word ; ID of symbol.
+.endstruct
+
+; Instruction struct.
+.struct instr
+ am .word ; Addressing modes.
+ op .byte ; Base value used to get the actual opcode.
+.endstruct
+
+
; Enums.
; I/O constants.
@@ -95,6 +161,7 @@ INDX2 = 1 << 11 ; Special case of INDX that uses the indirect table.
ZM2 = 1 << 12 ; Special case of Zero Matrix used by JMP, and JSR.
+
; RAM declarations.
; Linewrap table.
@@ -257,22 +324,22 @@ lexeme:
.res $100
; Symbol table.
-sym:
+symbol:
.res $8000
; Fixup table.
; Fixups are unresolved symbols.
-fix:
+fixup:
.res $2000
; ROM data declarations.
.org $A000
; String Literals/Constants.
-tok:
- .byte "dab"
-msg:
- .byte "oof, you divided a, and b on me.\n"
+;tok:
+; .byte "dab"
+;msg:
+; .byte "oof, you divided a, and b on me.\n"
ed_name:
.byte "SuBEditor"
@@ -714,7 +781,7 @@ cmd_srt:
.word list
.word asm
.word help
- .word inst
+ .word ins
.word run
.word set