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.s120
1 files changed, 96 insertions, 24 deletions
diff --git a/programs/sub-suite/declare.s b/programs/sub-suite/declare.s
index 55ccc2b..166197b 100644
--- a/programs/sub-suite/declare.s
+++ b/programs/sub-suite/declare.s
@@ -12,7 +12,7 @@ maxrow = 23 ; Screen's row count.
maxcol = 79 ; Screen's column count.
MAX_SYM = $800 ; Max symbol size.
-OPNUM = 87 ; Instruction count.
+OPNUM = 74 ; Instruction count.
; Directives.
DIR_ORG = 0 ; Origin.
@@ -34,13 +34,15 @@ TOK_STR = 6 ; String.
TOK_CHAR = 7 ; Character.
TOK_IND = 8 ; Indirect addressing.
TOK_IMM = 9 ; Immediate data.
-TOK_MNE = 10 ; Opcode/Mnemonic.
-TOK_RS = 11 ; Register size prefix.
-TOK_COMM = 12 ; Comment.
-TOK_HEX = 13 ; Hex value.
-TOK_DEC = 14 ; Decimal value.
-TOK_BIN = 15 ; Binary value.
-TOK_INCL = 16 ; Include file.
+TOK_BREG = 10 ; B register.
+TOK_MNE = 11 ; Opcode/Mnemonic.
+TOK_RS = 12 ; Register size prefix.
+TOK_OF = 13 ; Offset register prefix.
+TOK_COMM = 14 ; Comment.
+TOK_HEX = 15 ; Hex value.
+TOK_DEC = 16 ; Decimal value.
+TOK_BIN = 17 ; Binary value.
+TOK_INCL = 18 ; Include file.
; Pre-Tokens.
PTOK_DOT = 0 ; .
@@ -55,19 +57,20 @@ PTOK_PIPE = 8 ; |
PTOK_LBRAK = 9 ; (
PTOK_RBRAK = 10 ; )
PTOK_COMMA = 11 ; ,
-PTOK_X = 12 ; x
-PTOK_Y = 13 ; y
-PTOK_S = 14 ; s
-PTOK_P = 15 ; p
-PTOK_DQUOT = 16 ; "
-PTOK_SQUOT = 17 ; '
-PTOK_HASH = 18 ; #
-PTOK_SCOLN = 19 ; ;
-PTOK_DOLR = 20 ; $
-PTOK_PRCNT = 21 ; %
-PTOK_NUM = 22 ; 0-9
-PTOK_ALPH = 23 ; a-z A-Z
-PTOK_OTHR = 24 ; Everything else.
+PTOK_B = 12 ; b
+PTOK_X = 13 ; x
+PTOK_Y = 14 ; y
+PTOK_S = 15 ; s
+PTOK_P = 16 ; p
+PTOK_DQUOT = 17 ; "
+PTOK_SQUOT = 18 ; '
+PTOK_HASH = 19 ; #
+PTOK_SCOLN = 20 ; ;
+PTOK_DOLR = 21 ; $
+PTOK_PRCNT = 22 ; %
+PTOK_NUM = 23 ; 0-9
+PTOK_ALPH = 24 ; a-z A-Z
+PTOK_OTHR = 25 ; Everything else.
; Expressions.
EXPR_PLUS = 0 ; Plus.
@@ -201,14 +204,50 @@ valbuf:
cpybuf:
.res 8
-; Current token line.
+; Token ID, used by make_tok.
+t_id:
+ .res 1
+
+; Token type, used by make_tok.
+t_type:
+ .res 1
+
+; Number of spaces before a token, used by make_tok.
+t_space:
+ .res 1
+
+; Number of tabs before a token, used by make_tok.
+t_tab:
+ .res 1
+
+; Token value, used by make_tok.
+t_val:
+ .res 8
+
+; Token string, used by make_tok.
+t_str:
+ .res 8
+
+; Token symbol, used by make_tok.
+t_sym:
+ .res 8
+
+; Current token.
ctok:
.res 2
-; Last token line.
+; Last token.
ltok:
.res 2
+; Current line.
+cline:
+ .res 2
+
+; Last line.
+lline:
+ .res 2
+
; Lexeme type.
lex_type:
.res 1
@@ -679,6 +718,38 @@ cmd_srt:
.word run
.word set
+; Return table used by get_ctrlidx.
+ct_rtb:
+ .byte 2
+ .byte 0
+ .byte 1
+ .byte 0
+ .byte 3
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 5
+ .byte 4
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 6
+
+; Jump table for print_char's control codes.
+ct_jtb:
+ .word printc ; Everything else (print it).
+ .word nl ; Newline.
+ .word bs ; Backspace.
+ .word clr_scr ; Ctrl+L.
+ .word en_step ; Ctrl+S.
+ .word dis_step ; Ctrl+R.
+ .word esc ; Escape.
; Jump table for parsing pre-tokens.
swtab:
@@ -694,6 +765,7 @@ swtab:
.word ptok_lbrk ; PTOK_LBRAK
.word ptok_rbrk ; PTOK_RBRAK
.word ptok_com ; PTOK_COMMA
+ .word ptok_br ; PTOK_B
.word ptok_xr ; PTOK_X
.word ptok_yr ; PTOK_Y
.word ptok_sp ; PTOK_S
@@ -715,7 +787,7 @@ hex_char:
; Compare, and return table for pre-tokens.
ptok_tab:
- .byte ".@:=+-><|(),xysp\"\'#;$%"
+ .byte ".@:=+-><|(),bxysp\"\'#;$%"
; Compare, and return table for isdelm.
dtab:
.byte "\n,\"\' \\"