Allow specifying offset in addition to alignment

This commit is contained in:
ISSOtm
2020-04-08 00:40:41 +02:00
parent e82ad21704
commit b0ec8468e6
16 changed files with 154 additions and 44 deletions

View File

@@ -1,6 +1,6 @@
error: Section "conflicting alignment" is defined with conflicting 4-byte alignment and address $cafe
error: Section "conflicting alignment" is defined with conflicting 4-byte alignment (offset 0) and address $cafe
---
ERROR: -(18):
Section "conflicting alignment" already declared as aligned to 4 bytes
Section "conflicting alignment" already declared as aligned to 4 bytes (offset 0)
ERROR: -(18):
Cannot create section "conflicting alignment" (1 errors)

View File

@@ -0,0 +1,10 @@
IF !DEF(SECOND)
ATTRS equs ",ALIGN[3,7]"
ELSE
ATTRS equs ",ALIGN[4,14]"
ENDC
SECTION UNION "conflicting alignment", WRAM0 ATTRS
db
PURGE ATTRS

View File

@@ -0,0 +1,6 @@
error: Section "conflicting alignment" is defined with conflicting 8-byte alignment (offset 7) and 16-byte alignment (offset 14)
---
ERROR: -(18):
Section "conflicting alignment" already declared with incompatible 3-byte alignment (offset 7)
ERROR: -(18):
Cannot create section "conflicting alignment" (1 errors)

View File

@@ -0,0 +1,10 @@
IF !DEF(SECOND)
ATTRS equs ",ALIGN[3,7]"
ELSE
ATTRS equs ",ALIGN[3,6]"
ENDC
SECTION UNION "conflicting alignment", WRAM0 ATTRS
db
PURGE ATTRS

View File

@@ -0,0 +1,6 @@
error: Section "conflicting alignment" is defined with conflicting 8-byte alignment (offset 7) and 8-byte alignment (offset 6)
---
ERROR: -(18):
Section "conflicting alignment" already declared with incompatible 3-byte alignment (offset 7)
ERROR: -(18):
Cannot create section "conflicting alignment" (1 errors)

View File

@@ -11,6 +11,11 @@ SECTION UNION "c", HRAM[$FFC0]
ds 5
c1::
SECTION UNION "d", SRAM,ALIGN[8,$BA]
d1::
SECTION UNION "e", SRAM[$BABE]
SECTION "output 1", ROM0
dw a1,a2 ; $C00A, $C02A
@@ -19,3 +24,4 @@ SECTION "output 1", ROM0
SECTION "output 3", ROM0
db BANK(banked)
dw d1,d2 ; $ABBA, $BBBA

View File

@@ -12,6 +12,13 @@ b1: ; Same but in different sections now
ds 5
c2::
SECTION UNION "d", SRAM,ALIGN[12,$BBA]
ds $1000
d2::
SECTION UNION "e", SRAM,ALIGN[8,$BE]
SECTION "output 2", ROM0
dw a1,a2
dw b1,b2