ISSOtm
1d01268249
Remove LOAD FRAGMENT
...
It's very troublesome, with flaky semantics and a very restricted use space.
2021-05-03 10:51:55 +02:00
Rangi
296e5489c9
rgblink adjusts patches' PC offsets when merging FRAGMENTs
...
Fixes #869
2021-05-02 23:54:42 +02:00
Rangi
ca36422ac9
Parse 'ld hl, sp - <e8>' correctly
...
Fixes #864
2021-05-01 11:08:01 +02:00
Rangi
43cf20b155
Support Mac OS classic CR line endings in linkerscripts
...
This also refactors `readChar(file)` to `nextChar()` to be
more like the rgbasm lexer.
2021-04-26 12:05:36 -04:00
Rangi
e27a6d53a0
Support character escapes in linkerscript strings
...
This allows linkerscripts to refer to section names even if
they contain special characters: '\r' '\n' '\t' '"' '\\'.
2021-04-26 12:05:36 -04:00
Rangi
52797b6f68
Implement SIZEOF("Section") and STARTOF("Section") ( #766 )
...
Updates the object file revision to 8
Fixes #765
2021-04-17 18:36:26 -04:00
Rangi
9923fa3eee
Fix expansions that start from the end of another expansion ( #839 )
...
Do not free an expansion until its offset is *past* its size.
This means potentially freeing a nested stack of expansions
all at once.
Fixes #696
2021-04-17 13:14:40 -04:00
Jakub Kądziołka
1ffd7cb5bb
Make tests work on NixOS
...
Some distributions, such as NixOS and Guix, only have the /bin/sh and
/usr/bin/env binaries in standard locations.
2021-04-16 16:38:04 +02:00
Rangi
a265b85d9d
Report "1 error", not "1 errors", when assembly is aborted
...
This matches other such pluralized error messages
2021-03-28 15:55:32 -04:00
Rangi
7e7f92f18c
Assign section locations to all UNIONs/FRAGMENTs
...
Fixes the test case from #800
The `out.gb` output was corrected, since the two "test"
fragments have a different order in ROM than in SRAM.
It is effectively:
; ROM0[$0000], fragments ordered by size
jr Label
dw Label
db 0
; SRAM[$a000], fragments ordered by .o order
ds 1 ; db 0
ds 2 ; jr Label
Label: ; $a003
ds 2 ; dw Label
2021-03-28 15:21:17 -04:00
Eldred Habert
7461170956
Add LOAD FRAGMENT pc test ( #800 )
...
Reproduces a reported problem, fix pending
2021-03-28 15:11:20 -04:00
Rangi
8d1b56bcf5
rgblink identifies patches' PC sections after reading all sections
...
Fixes #794
2021-03-18 23:53:54 +01:00
Rangi
e7d6ddf593
Fix linking tiny overlay files ( #755 )
...
* Fix compatibility of rgblink -O and -t
The -t "tiny mode" option makes ROM0 cover 0x8000 bytes,
not 0x4000. The -O "overlay" option fills areas uncovered
by sections with data from an overlay file. These needed
to cooperate so that the calculated uncovered overlay size
does not exceed the actual size of the ROM.
Fixes #754
* Print link test names like asm tests do
* Make the three test.sh scripts more similar
2021-02-24 23:04:51 -05:00
Eldred Habert
dafef5a953
Remove column 1 restriction for labels with colons ( #635 )
...
Partial fix for #457
2021-02-23 14:42:24 -05:00
Rangi
037bc7abb3
Add an rgblink test case for an $8000-byte ROM0 section with -t
2021-02-21 16:30:02 -05:00
ISSOtm
76446e6d00
Change behavior of merging FRAGMENTs to constrain each fragment individually
...
Additionally, remove the deprecated merging of non-fragment SECTIONs
2021-02-10 10:19:16 +01:00
ISSOtm
7bc42d468b
Clean up temp test files even if interrupted
...
Avoids "tmp.*" piling up in /tmp
2020-12-26 14:38:04 +01:00
Jakub Kądziołka
b421c983d6
link: Suppress cascading errors.
2020-10-04 18:14:22 +02:00
ISSOtm
baeb180acd
Apply error reporting changes to tests
2020-10-04 04:45:58 +02:00
Eldred Habert
c6eacde55e
Merge pull request #544 from ISSOtm/atomic_ind
...
Split register-indirect tokens
2020-08-05 10:52:18 +02:00
ISSOtm
6563133426
Avoid using echo -e in tests
2020-07-27 18:26:05 +02:00
ISSOtm
762474d3ac
Let RGBASM write JR offsets in floating sections
...
This requires some special-casing for `jr @` because the `jr` opcode has
already been emitted, but not the operand, so PC points to the middle.
Moved the RGBLINK test to RGBASM's folder, and created a new RGBLINK test.
2020-07-27 18:17:29 +02:00
ISSOtm
ca6fa6d1d7
Split register-indirect tokens
...
This allows whitespace between the brackets and the register.
This also fixes #531
Note that `$ff00 + c` is still treated as a single token, because trying to
use an expression on the left side causes a shift/reduce conflict.
This isn't great, but most people seem to be either used to it as-is, or
using the new `ldh a, [c]` syntax.
If this causes problems with a lexer rewrite, it'll be deprecated; but for
now, keep it around, as the support is clunky but bearable.
2020-07-22 15:00:39 +02:00
ISSOtm
1f2f797cb9
Add section fragments
...
Fixes #517 , and hopefully enables RGBDS as a SDCC back-end
2020-07-21 19:56:46 +02:00
James Larrowe
5c24de3dc4
Use inttypes for stdint types
...
This should help make RGBDS portable to systems with 16-bit integers,
like DOS.
For kicks, use the macros for 16-bit and 8-bit integers.
Fix other miscellaneous things, like #include ordering and other
printf-format related things.
Reduce repitition in math.c while I'm there.
2020-05-07 11:10:20 -04:00
ISSOtm
023a3c037f
Properly handle missing symbols
...
Fixes #512
2020-04-12 22:52:32 +02:00
ISSOtm
b0ec8468e6
Allow specifying offset in addition to alignment
2020-04-08 00:40:41 +02:00
ISSOtm
190678107b
Prevent RGBLINK from crashing when getting the bank of a constant
2020-04-07 20:41:29 +02:00
ISSOtm
82e0e4ffaf
Make some RGBLINK errors non-fatal
2020-04-06 00:48:10 +02:00
ISSOtm
ffb199a26a
Avoid Useless Use of backticks in rgblink testing
2020-04-06 00:44:59 +02:00
ISSOtm
175933d2b1
Remove old scripts for updating references for tests
...
I much rather prefer correcting everything by hand, and gauging
whether the change is good on a case by case basis
2020-04-06 00:41:37 +02:00
ISSOtm
92134d7684
Add testing for assertions inside unionized sections
2020-03-22 11:14:04 +01:00
ISSOtm
4877bb783c
Add more tests for unionized sections + fix bugs
...
Implementing those tests found a few bugs... oops
2020-03-22 11:14:04 +01:00
ISSOtm
e123b6dec7
Implement unionized sections in RGBLINK
2020-03-22 11:13:39 +01:00
ISSOtm
fb58166e5d
Add assertions
...
Closes #292
2020-03-21 23:00:38 +01:00
ISSOtm
eb445271df
Remove carryover from RGBASM in RGBLINK tests
2020-03-20 21:50:38 +01:00
ISSOtm
8c4b473d6f
Add more checks to section creation in RGBASM
...
Fixes rednex#471, but also backports a couple more checks from RGBLINK
2020-02-10 03:35:55 +01:00
ISSOtm
b42a04c24e
Add test for jr @
...
Fun fact: current build *fails* this test!
2020-02-07 13:19:50 +01:00
ISSOtm
9687e6e1dd
Allow forcing the second byte of STOP
...
Fixes #433
2020-02-07 10:06:02 +01:00
ISSOtm
ee34200e5f
Output diffs when binary tests fail
2020-02-06 15:36:15 +01:00
ISSOtm
295fc6c619
Improve coverage of db-@ test
2020-02-05 13:24:50 +01:00
ISSOtm
35f7340dc9
Report failing test names in RGBLINK as well
2020-02-04 01:41:35 +01:00
ISSOtm
b1cd730db2
Add link-time RST instruction
...
This allows using a label as the argument to a `rst` instruction
Fixes rednex#448
2020-02-03 21:07:12 +01:00
ISSOtm
ed06981f57
Add test for db X, @
...
It should behave identically to both of these on separate lines
2020-01-28 21:04:41 +01:00
ISSOtm
1bd41bf79a
Don't use diff to compare bin files in tests
2020-01-26 21:10:31 +01:00
Eldred Habert
fb81733b2b
Merge pull request #472 from ISSOtm/romx-tiny
...
Allow ROMX and WRAMX sections in restricted modes
2020-01-26 14:48:32 +01:00
ISSOtm
1f8422575e
Test that all-instructions does not error out
2020-01-21 03:05:22 +01:00
ISSOtm
61c381a62c
Systemize RGBLINK testing
2020-01-21 03:01:58 +01:00
ISSOtm
71fe652556
Allow ROMX and WRAMX sections in restricted modes
...
Closes #462 , although with this implementation `BANK("some ROMX section")` would
return 0 instead of 1, which I think is benign anyways
2020-01-16 22:24:05 +01:00
ISSOtm
2c52364978
Add test for fixed section addresses
2020-01-16 18:12:42 +01:00