Files
rgbds/test/asm/label-scope.asm
Rangi42 752e2b3620 Symbol names with more than two '.'s could be defined as constants
Dot-only names could also trip an assertion in `make develop`
when used as labels
2025-12-04 15:15:41 -05:00

33 lines
411 B
NASM

ASSERT !DEF(@) && !DEF(.) && !DEF(..)
PURGE @, ., ..
SECTION "test", ROM0[42]
db 1
Foo:
db 2
.bar
db 3
PURGE @, ., ..
ASSERT DEF(@) && DEF(.) && DEF(..) && DEF(Foo) && DEF(.bar)
PRINTLN "PC: {#05X:@}"
PRINTLN "global scope: \"{.}\" ({#05X:{.}})"
PRINTLN "local scope: \"{..}\" ({#05X:{..}})"
SECTION "can't redefine", ROM0
#.
#.:
#.?
DEF #. EQUS "global"
jp #.
#..
#..:
#..?
DEF #.. EQUS "local"
jp #..