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>
A lot of warnings are being added (and more will come) so it makes sense
to be able to disable them in legacy source that generates warnings but
is otherwise correct.
Signed-off-by: AntonioND <antonio_nd@outlook.com>
When calculating the difference of addresses between two labels, for it
to be defined, either:
- Both of them must have their absolute address defined.
- They belong to the same section, so their relative addresses are
compatible.
This patch adds a check to make sure that any other case is detected so
that the programmer can correct the code.
This applies to rgbasm. The difference of labels can be used, for
example, as argument of DS. The linker can't resize sections, which
means that the final value must be defined when creating the object
file.
Signed-off-by: AntonioND <antonio_nd@outlook.com>
This patch isn't used because it's meant to be an optimization for
labels in the memory region 0x2000-0x20FF. That memory region doesn't
have anything special on the Game Boy, and there are no instructions
optimized to read or write from there, so it was probably meant for
another hardware that was supported by ASMotor in the past.
Signed-off-by: AntonioND <antonio_nd@outlook.com>
This function produces a similar output to the other error handlers, including printing to stderr, and including a stack trace. However, ‘warning’ is displayed instead of ‘ERROR’, and the compilation does not fail.
This function is now used for the deprecation warnings, ensuring that these errors can be found.
Aligned sections can now be created with out_NewAlignedSection(). This information is stored in created object files, and read by the linker.
The names of each section are also included in the object file, enabling potential improvements to error messages in the future.
Increase number of include paths that can be passed through the
command line interface. The previous number, 16, is only good enough
for small projects. 128 is still an arbitrary number, but it is harder
to reach.
- separated the lexer into multiple functions so it is more readable
- fixed issue with long label names in macro arguments
- added error checking code to prevent buffer overflows
Merging lai's source with this one is very irritating because
they have different indentation styles. I couldn't find what profile
vegard used for his version, so I used these flags (which should bring
the source close to KNF):
-bap
-br
-ce
-ci4
-cli0
-d0
-di0
-i8
-ip
-l79
-nbc
-ncdb
-ndj
-ei
-nfc1
-nlp
-npcs
-psl
-sc
-sob