Hi.

While doing a small project for zx spectrum with sdcc I stumbled upon
a small problem that was fun to diagnose. It's not a bug in sdcc, but
a couple small features would help avoid such problems in the future.

Basically, after adding some innocent code to the project, the program
would crash and burn in spectacular way. Switching order of linked
objects changed the way the program crashed, but didn't remove the
problem.

Eventually I realized (when checking my compiler options and glancing
at my diagnostic memory map) that the --data-loc overlapped the code.
After moving it out of the way things worked again.

This is something that should be relatively easy for the linker to
check and give warning about.

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.

Cheers,
  Jari

------------------------------------------------------------------------------
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