They are still working, they just output a warning.
`jp [hl]` is confusing as it may be thought that the CPU reads the value
pointed by hl and jumps to it.
`ldi a,hl` and `ldd a,hl` are also confusing as they load from the
address pointed by `hl`, the correct mnemonic should say `[hl]`.
Signed-off-by: AntonioND <antonio_nd@outlook.com>
Print the name of each section along with the size, base and end
addresses. If a section is empty, don't print the end address, as it
can overflow if the base address is 0.
Signed-off-by: AntonioND <antonio_nd@outlook.com>
Previously, some instances of the number of banks for each section remained hardcoded. These have been replaced with BANK_COUNT_* constants.
As a side-effect, this could fix a theoretical bug when using BANK(label) when the label is in a high SRAM bank (≥ 4).
Yay, more refactoring of the section assignment… This version of the linker will allocate sections by their alignment, and then by their size (largest first, in both cases).
In future, this may be improved by using dense packing (as suggested by #83).
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.
Instead of reading into a pre-sized buffer, this function now uses malloc to create a buffer, and resizes it if necessary.
This reduces the risk of memory issues if a long string (< 255 chars) was encountered.
Ensure that IF constructs, REPT blocks, and MACRO defintions are terminated with ENDC, ENDR, or ENDM respectively. If they are not, print an error and stop assembly.
As well as aiding a forgetful programmer, this reduces the risk of memory problems if the file ends less than four bytes after the block starts.
Deduplicates and generalises a lot of code in assign.c:
- Replace area_AllocAbs*AnyBank() with area_AllocAbsAnyBank() function
that accepts a section type parameter
- Replace area_Alloc*AnyBank() with area_AllocAnyBank()
- Replace FindLargest*() with FindLargestSection()
- Replace Assign*Sections() with AssignBankedSections()
- Add VerifyAndSetBank(), which enables bank checks (and addition with
BANK_*) to be centralised
- Refactor the initialisation of AssignSections(), removing some magic
numbers and only setting MaxAvail[i] once
- Overhaul the duplicated cases throughout AssignSections()