Hello Peter,

As stated in the documentation, the ABS areas "automatically invokes 
OVR" (Page 1-27, .area Directive), so (ABS) or (ABS,OVR) have the same 
effect, indeed I've tried what you suggested resulting in the same behavior.


I think I've managed to workaround this issue in my case. I don't known 
if it's the best way to solved but is good enough for me. It seems that 
the sdld linker needs to be explicitly informed where to put the 
different areas, so I've declared an global symbol at the end of the 
boot.asm file:


; boot.asm

.globl HexToU8, BOOT_END
.area _START (ABS)
    .org 0
    ld        SP, #0xFFFF
    call     HexToU8
BOOT_END:

And used the linker flags "-i -b _CODE=BOOT_END -b _START=0" to inform the 
start address for the areas. The other files that uses the _CODE(REL,CON) area 
the linker relocate them as expected.

Thanks.


On 18-08-2016 00:02, Peter Van Epp wrote:
>       While I don't have sdcc loaded at the moment, and haven't used it
> for Z80, isn't the OVR in  .area _START (ABS,OVR) indicating that that
> segment can be overlayed (which is not what you want)? I'd check the linker
> manual or just try removing it and see if your problem goes away.
>
> Peter Van Epp
>
> On Wed, Aug 17, 2016 at 11:01:05PM -0300, Augusto Fraga Giachero wrote:
>> I've tried what you suggested, linking the boot.rel first results in the
>> opposite effect, the _START area gets overwritten by the _CODE area.
>> Here a small showcase for the problem I'm having:
>>
>>
>> ; boot.asm:
>> .globl HexToU8
>> .area _START (ABS,OVR)
>>
>>       .org 0
>>       ld        SP, #0xFFFF
>>       call     HexToU8
>>
> ------------------------------------------------------------------------------
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user


------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to