Files that weren't found with the absolute path weren't added as
dependencies even if they were found after considering the list of
include directories.
This patch makes rgbasm print the complete path (including the include
directory path) in these cases.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
For some reason, `No` looks weird in the HTML version of the docs.
Some other random fixes.
Tables in src/asm/rgbasm.5 are still broken in the HTML docs.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
When including a linkerscript from a parent one, the lexer didn't
include a newline character because the INCLUDE command was handled
before reaching the newline. This behaviour is needed to parse the last
line of a linkerscript correctly (it doesn't have a newline character).
However, this meant that when the included file was being parsed, the
first line was considered a continuation of the last line of the parent
script (the INCLUDE command), which means that the first line of an
included linkerscript could only contain a comment (or nothing at all).
This patch adds a newline character to the buffer used by the lexer so
that the parser will receive a newline and it will handle the first line
of the included file as expected.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
`LD HL,n16` and `LD SP,n16` are handled in a different rule as
`LD r16,n16`, but they are also part of that rule.
This patch converts the `LD r16,n16` rule into two rules, one for doing
`LD BC,n16` and other one for `LD DE,n16`.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
rgblink option -w has been restored to its previous behaviour: make WRAM
a continous section instead of spliting it into WRAM0 and WRAMX.
To enable DMG mode, option -d has to be used instead. This option
automatically enables -w.
Update tests.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
If the next release is going to break compatibility with older object
file formats it doesn't make sense to keep this.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
Added `__TIMESTAMP_ISO_8601_LOCAL__` and `__TIMESTAMP_ISO_8601_UTC__`,
with the correct ISO 8601 representation of time and date from years to
seconds (including local timezone in the local time string).
Also, if the current time cannot be obtained from the OS, it will output
a warning and the time strings will be filled with '?' instead of
numbers and characters.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
If they don't have quotes when passed to sym_AddString() they can't be
used at all by the assembler. I suppose nobody actually used them, they
seem to have been broken forever.
Added a comment to the function to say how to use it correctly for
strings.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
IMPORT is simply useless, any symbol that isn't found in the current
file is automatically flagged as imported symbol.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
Files can now be included with the following syntax:
INCLUDE "path.link"
The maximum include depth is 5.
Fixed linkerscript parser and lexer error messages so that they are more
informative (show file and line of the error).
Man page updated.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
The error message shouldn't specify the name of the binary, that's
supposed to be known by the caller.
Update test reference outputs.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
It compares the results of the operators with the expected result if
doing the same thing manually.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
They work with the 16-bit registers BC, DE and HL, returning the
corresponding 8-bit register. HIGH() works with AF as well, returning A.
They also work with any kind of constant or symbol, generating a RPN
patch in the object file if the value is not defined at assembly time.
They work with macro arguments as well.
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>