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

And yes sorry I didn't read this carefully enough the first time to
realise you were doing the code not data. The theory is the same but move
the code in your tool from its RAM location to ROM with a straight copy.
Put a small memory copier at the start in its own segment that copies the
C code to RAM and then jumps. Don't try writing the memory copier in C
because you'll call inline functions in the RAM which are not yet in the
right place!

Providing you link it where you want it to end up the chunk of code
generated is already relocated correctly and can be stored as a block
anywhere you want, provided you then copy it to the right address before
executing it.

Alan

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

Reply via email to