mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 03:02:06 +00:00
Merge pull request #374 from Ben10do/pushs-outside-of-section
Allow PUSHS to be used before a section
This commit is contained in:
@@ -22,7 +22,7 @@ Main contributors
|
|||||||
Other contributors
|
Other contributors
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
- Ben10do
|
- Ben Hetherington <dev@ben-h.uk>
|
||||||
|
|
||||||
- Björn Höhrmann <bjoern@hoehrmann.de>
|
- Björn Höhrmann <bjoern@hoehrmann.de>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of RGBDS.
|
* This file is part of RGBDS.
|
||||||
*
|
*
|
||||||
* Copyright (c) 1997-2018, Carsten Sorensen and RGBDS contributors.
|
* Copyright (c) 1997-2019, Carsten Sorensen and RGBDS contributors.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
@@ -655,7 +655,7 @@ void out_SetCurrentSection(struct Section *pSect)
|
|||||||
fatalerror("Cannot change the section within a UNION");
|
fatalerror("Cannot change the section within a UNION");
|
||||||
|
|
||||||
pCurrentSection = pSect;
|
pCurrentSection = pSect;
|
||||||
nPC = pSect->nPC;
|
nPC = (pSect != NULL) ? pSect->nPC : 0;
|
||||||
|
|
||||||
pPCSymbol->nValue = nPC;
|
pPCSymbol->nValue = nPC;
|
||||||
pPCSymbol->pSection = pCurrentSection;
|
pPCSymbol->pSection = pCurrentSection;
|
||||||
|
|||||||
1
test/asm/pops-no-pushed-sections.asm
Normal file
1
test/asm/pops-no-pushed-sections.asm
Normal file
@@ -0,0 +1 @@
|
|||||||
|
POPS
|
||||||
2
test/asm/pops-no-pushed-sections.out
Normal file
2
test/asm/pops-no-pushed-sections.out
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ERROR: pops-no-pushed-sections.asm(1):
|
||||||
|
No entries in the section stack
|
||||||
2
test/asm/pops-no-pushed-sections.out.pipe
Normal file
2
test/asm/pops-no-pushed-sections.out.pipe
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ERROR: -(1):
|
||||||
|
No entries in the section stack
|
||||||
10
test/asm/pops-restore-no-section.asm
Normal file
10
test/asm/pops-restore-no-section.asm
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
PUSHS
|
||||||
|
|
||||||
|
SECTION "Test", ROM0
|
||||||
|
SomeContent:
|
||||||
|
db 1, 2, 3, 4, 5, 6, 7, 8, 9
|
||||||
|
|
||||||
|
POPS
|
||||||
|
|
||||||
|
DisallowedContent:
|
||||||
|
db 0
|
||||||
2
test/asm/pops-restore-no-section.out
Normal file
2
test/asm/pops-restore-no-section.out
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ERROR: pops-restore-no-section.asm(10):
|
||||||
|
Code generation before SECTION directive
|
||||||
2
test/asm/pops-restore-no-section.out.pipe
Normal file
2
test/asm/pops-restore-no-section.out.pipe
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ERROR: -(10):
|
||||||
|
Code generation before SECTION directive
|
||||||
2
test/asm/pushs-outside-section.asm
Normal file
2
test/asm/pushs-outside-section.asm
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
PUSHS
|
||||||
|
POPS
|
||||||
0
test/asm/pushs-outside-section.out
Normal file
0
test/asm/pushs-outside-section.out
Normal file
0
test/asm/pushs-outside-section.out.pipe
Normal file
0
test/asm/pushs-outside-section.out.pipe
Normal file
Reference in New Issue
Block a user