Closed shazz closed 3 years ago
Yeah.. The !if ... {}
starts a new anonymous block. Any declarations within the block are not accessible from the outer scope. The scoping rules work more like C scopes, not like preprocessor macros.
Here's how I'd suggest you write it:
!let DEBUG = 0
!let dataptr = $2800
!if (DEBUG == 1) {
* = $2000
!!dataptr = *
lbl: !byte 12
}
lda dataptr
Hum, I did not think to use !!dataptr = *, That works :)
Example:
Error:
Maybe this is because data is a label in one case and a variable in the second one?