On Fri, 04 Sep 2015 14:05:18 +0200
Hynek Sladky <ec...@centrum.cz> wrote:

> Hello,
> 
> I need to run assembly code in RAM. Is there any way how to write such 
> source code? I need the compiler to produce "initialization" data in ROM 
> which will contain the code with all addresses calculated for RAM 
> placement, so the code can be a part of initialized data...

Mostly it's easy. SDCC was making a horrible mess of statics initialized
inside a function by generating code to init them, so on Z80 so avoid
those but otherwise:

Build the binary with the SDCC tools putting the initialization data
somewhere unused.

Copy the initialization data over the initialized data locations in the
binary with a tool on your compiling box

And done..

Fuzix does this (and some other stuff) but take a look at the binmunge
tools on the Fuzix git tree, particularly the one for applications.

If you have to them sorting the static initializers out involves running
the app on an emulator, snapshotting just after the constructors and
initializers run and then dumping that back out and using it on the real
hardware.

Alan

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

Reply via email to