> According to documentation, if I don't use --data-loc, the location is
> set to "as low in memory as possible". I don't know what this would
> result in with zx spectrum, where the low 16k is ROM, next 6k or so is
> display memory, and the 16k-32k is "slow memory" which one would
> probably avoid using if possible.. It would be nice if there was an
> option to calculate and place the --data-loc right after code ends.

If your crt0.s lists CODE then DATA (as is normal) then it will put the
data and the like directly after the code unless you specify a --data-loc.
So if you specify --code-loc 32768 and don't specify a data-loc or have
one in the linker file it'll pack code/cost/data/etc with all the free
memory at the top.

If you use linker scripts you can also add other segments and pack them
in different places (eg to link a table in the printer buffer on the
spectrum or build some code into the slow memory space).

The only thing to watch is that sdcc on Z80 does not put all constant
text strings in CONST, some of them end up in whatever section that piece
of code is in. That seems to be a be an SDCC bug but doesn't usually
matter.

Also take a look at the address spaces stuff - that will let you
handle banked data on the 128K machines. I've got a few add on patches and
linker hacks that will build Spectrum 128K banked binaries as well so you
can use upper 16K banks for chunks of code.

Alan

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to