diff --git a/doc/Checking.markdown b/doc/Checking.markdown index 05bcba8..807d91e 100644 --- a/doc/Checking.markdown +++ b/doc/Checking.markdown @@ -241,6 +241,31 @@ Even in inner blocks. | } ? undeclared location +Block-level declarations are visible in inner blocks. + + | routine main { + | reserve byte lives + | with sei { + | if beq { + | lda #3 + | repeat bne { + | sta lives + | } + | } else { + | sta lives + | } + | } + | } + = True + +A block-level `reserve` may not supply an initial value. + + | routine main { + | reserve byte lives : 3 + | lda lives + | } + ? block-level 'lives' cannot supply initial value + All routines jsr'ed to must be defined, or external. | routine main { diff --git a/eg/game.60p b/eg/game.60p index 4f2dcd0..4ebb98c 100644 --- a/eg/game.60p +++ b/eg/game.60p @@ -33,8 +33,6 @@ reserve vector dispatch_state reserve byte[18] press_fire_msg: "PRESS FIRE TO PLAY" -reserve byte save_x // TODO: SHOULD BE BLOCK LOCAL! - routine calculate_new_position outputs (new_position) { clc lda