Sebastian 'basxto' Riedel wrote on 2020-07-23 15:02:
On 23.07.20 14:35, Maarten Brock wrote:
Sebastian 'basxto' Riedel wrote on 2020-07-23 13:02:
Is there a reason why __CODE and __DATA aren't set to default values
in the linker and instead the values defined in z80/main.c get passed
via command line arguments when called via `bin/sdcc`?
What default values would you expect? The z80 does not have internal
rom and ram lain out in a default memory map.
In the .lk file I see that `sdcc -mgbz80` calls sdasgb with `-b _CODE
= 0x0200 -b _DATA = 0xc000` if you don't set code-loc or data-loc.
If you switch from sdcc to sdasgb you suddenly have to explicitly
define them, since they are 0x0 otherwise, which is a bit weird.
I guess this more relevant to gbz80 then, RAM has a fixed location
there and CODE can't be at 0x0 because it would overwrite the ROM
header otherwise or getting overwritten when the header gets fixed.
The reason is probably that the original ASxxxx didn't and doesn't have
those defaults and SDCC developers decided it would be wise to provide
them. In general, it's wise to only change sdas when absolutely
necessary. And sdas/ASxxxx has a way to pass these values.
I also wonder why you ask this on the user mailing list. Are you
expecting answers from the users to this question?
I was wondering from a user perspective. So those mailing lists are
rather about who you wanna ask?
Oh, ok. It seemed like a question from a developer to the other
developers trying to understand the inner workings.
I don't believe there are many users that use sdld* directly.
Maarten
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user