Mercurial > hg > index.cgi
comparison src/progctrl.s @ 128:9d57279c900e
Remove old style keyword lists and jump tables
As part of the move to the new pre-parsing scheme, remove the old keyword
lists and jump tables. The main loop still needs modification to work with
this new system.
author | William Astle <lost@l-w.ca> |
---|---|
date | Tue, 09 Jan 2024 22:54:42 -0700 |
parents | a6a53e5c04bd |
children | 917b4893bb3d |
comparison
equal
deleted
inserted
replaced
127:527212870064 | 128:9d57279c900e |
---|---|
103 stx inputptr ; put input pointer there | 103 stx inputptr ; put input pointer there |
104 rts ; resume interpretation at the new location | 104 rts ; resume interpretation at the new location |
105 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 105 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
106 ; GOSUB command | 106 ; GOSUB command |
107 cmd_gosub jsr parse_lineno ; parse the destination line so return location is after the line number | 107 cmd_gosub jsr parse_lineno ; parse the destination line so return location is after the line number |
108 ldd #tok_gosub*256+4 ; stack frame details | 108 ldd #token_gosub*256+4 ; stack frame details |
109 jsr cstack_alloc ; make a stack frame | 109 jsr cstack_alloc ; make a stack frame |
110 ldx curline ; save current line pointer | 110 ldx curline ; save current line pointer |
111 stx ,u | 111 stx ,u |
112 ldx inputptr ; save current input pointer | 112 ldx inputptr ; save current input pointer |
113 stx 2,u | 113 stx 2,u |
125 bne cmd_return1 ; brif there's a frame - don't error | 125 bne cmd_return1 ; brif there's a frame - don't error |
126 RG_ERROR ldb #err_rg ; raise RETURN without GOSUB | 126 RG_ERROR ldb #err_rg ; raise RETURN without GOSUB |
127 jmp ERROR | 127 jmp ERROR |
128 cmd_return0 jsr cstack_next ; move to next entry | 128 cmd_return0 jsr cstack_next ; move to next entry |
129 beq RG_ERROR ; brif end of stack - raise error | 129 beq RG_ERROR ; brif end of stack - raise error |
130 cmd_return1 cmpb #tok_gosub ; do we have a GOSUB frame? | 130 cmd_return1 cmpb #token_gosub ; do we have a GOSUB frame? |
131 bne cmd_return0 ; brif not - try again | 131 bne cmd_return0 ; brif not - try again |
132 lda ,s+ ; is it "POP"? | 132 lda ,s+ ; is it "POP"? |
133 bne cmd_return2 ; brif so - don't change flow control but clear stack frame | 133 bne cmd_return2 ; brif so - don't change flow control but clear stack frame |
134 ldx ,u ; get back saved line pointer | 134 ldx ,u ; get back saved line pointer |
135 stx curline | 135 stx curline |