Block-level decls are visible in inner blocks.
Cat's Eye Technologies
10 years ago
239 | 239 |
| }
|
240 | 240 |
| }
|
241 | 241 |
? undeclared location
|
|
242 |
|
|
243 |
Block-level declarations are visible in inner blocks.
|
|
244 |
|
|
245 |
| routine main {
|
|
246 |
| reserve byte lives
|
|
247 |
| with sei {
|
|
248 |
| if beq {
|
|
249 |
| lda #3
|
|
250 |
| repeat bne {
|
|
251 |
| sta lives
|
|
252 |
| }
|
|
253 |
| } else {
|
|
254 |
| sta lives
|
|
255 |
| }
|
|
256 |
| }
|
|
257 |
| }
|
|
258 |
= True
|
|
259 |
|
|
260 |
A block-level `reserve` may not supply an initial value.
|
|
261 |
|
|
262 |
| routine main {
|
|
263 |
| reserve byte lives : 3
|
|
264 |
| lda lives
|
|
265 |
| }
|
|
266 |
? block-level 'lives' cannot supply initial value
|
242 | 267 |
|
243 | 268 |
All routines jsr'ed to must be defined, or external.
|
244 | 269 |
|
31 | 31 |
reserve vector dispatch_state
|
32 | 32 |
|
33 | 33 |
reserve byte[18] press_fire_msg: "PRESS FIRE TO PLAY"
|
34 | |
|
35 | |
reserve byte save_x // TODO: SHOULD BE BLOCK LOCAL!
|
36 | 34 |
|
37 | 35 |
routine calculate_new_position outputs (new_position) {
|
38 | 36 |
clc
|
|
169 | 167 |
}
|
170 | 168 |
|
171 | 169 |
routine state_play_game {
|
172 | |
// reserve byte save_x
|
|
170 |
reserve byte save_x
|
173 | 171 |
ldx #0
|
174 | 172 |
repeat bne {
|
175 | 173 |
stx save_x
|
211 | 211 |
mapInstrName n1 n2 (DELTA sl1 v) =
|
212 | 212 |
DELTA (mapStorageLocationName n1 n2 sl1) v
|
213 | 213 |
|
|
214 |
mapInstrName n1 n2 (IF id branch b1 b2) =
|
|
215 |
IF id branch (mapBlockNames n1 n2 b1) (mapBlockNames n1 n2 b2)
|
|
216 |
|
|
217 |
mapInstrName n1 n2 (REPEAT id branch b1) =
|
|
218 |
REPEAT id branch (mapBlockNames n1 n2 b1)
|
|
219 |
|
|
220 |
mapInstrName n1 n2 (WITH instr b1) =
|
|
221 |
WITH instr (mapBlockNames n1 n2 b1)
|
|
222 |
|
214 | 223 |
{-
|
215 | |
| IF InternalID Branch Block Block
|
216 | |
| REPEAT InternalID Branch Block
|
217 | |
| WITH WithInstruction Block
|
218 | 224 |
| COPYROUTINE RoutineName StorageLocation
|
219 | 225 |
-}
|
220 | 226 |
|