On 04.09.2015 16:32, Alan Cox wrote: >> 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
I assumed that he only wants some small special part of his code to execute from RAM. In that case he could use C memcpy() to copy, but would have to place the special code in a different segment. Philipp
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------
_______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user