Allow STARTOF(SECTTYPE) and SIZEOF(SECTTYPE) to be constant when possible (#2131)

This commit is contained in:
Rangi authored and GitHub committed 2026-09-26 19:08:28 +02:00
1 parent 548a11c3ef
commit e0ee6c9013
6 files changed
+45 -6

No files matched your search

@@ -0,0 +1,5 @@
SECTION "ROM0", ROM0[STARTOF(ROM0)]
Label:: ds SIZEOF(ROM0)
SECTION "WRAM0", WRAM0[STARTOF(WRAM0)]
wLabel:: ds SIZEOF(WRAM0)
@@ -0,0 +1,5 @@
error: Expected constant expression: Section type ROM0's size is not known (can be affected by RGBLINK '-t/--tiny')
at secttype-sizeof-startof-unknown.asm(2)
error: Expected constant expression: Section type WRAM0's size is not known (can be affected by RGBLINK '-w/--wramx')
at secttype-sizeof-startof-unknown.asm(5)
Assembly aborted with 2 errors
+13
View File
@@ -0,0 +1,13 @@
SECTION "ROMX", ROMX[STARTOF(ROMX)], BANK[1]
xLabel:: ds SIZEOF(ROMX), $22
SECTION "VRAM", VRAM[STARTOF(VRAM)], BANK[0]
vLabel:: ds SIZEOF(VRAM)
SECTION "ROM0", ROM0[STARTOF(ROM0)]
ASSERT !ISCONST(SIZEOF(ROM0)) ; rgblink may have -t/--tiny
Label:: ds $4000, $11
SECTION "WRAM0", WRAM0[STARTOF(WRAM0)]
ASSERT !ISCONST(SIZEOF(WRAM0)) ; rgblink may have -w/--wramx
wLabel:: ds $1000
+1
View File
@@ -0,0 +1 @@
Line truncated