Relocatable code cannot be properly generated with .h and .l expressions in the 6800 assembler, as also indicated in comments of 6500/as/mach4.c:
* The .h and .l extensions of expressions are vital. However, they prevent
* relocatable code from being generated. Consider the following example:
*
* (file 1)
* .sect .text ! 1
* lda #[endbss].l ! 2
* ldx #[endbss].h ! 3
*
* (file 2)
* .sect .bss ! 4
* endbss: ! 5
*
* Wat voor relocation struct moet er nu voor de instructie in regel 3
* worden geproduceerd?
*
* What kind of relocation structure needs to be generated for the instruction
* in line 3?
On MC6800, address calculations like for global array elements require:
ldab #[_var].l
ldaa #[_var].h
addb _off+1
adca _off
Due to this limitation, the assembler cannot generate such code, resulting in inefficient or complicated output.
Are there any known solutions, workarounds, or community-contributed examples for dealing with this situation? Any shared experience would be very helpful.
Relocatable code cannot be properly generated with .h and .l expressions in the 6800 assembler, as also indicated in comments of 6500/as/mach4.c:
On MC6800, address calculations like for global array elements require:
Due to this limitation, the assembler cannot generate such code, resulting in inefficient or complicated output.
Are there any known solutions, workarounds, or community-contributed examples for dealing with this situation? Any shared experience would be very helpful.