Re: [Sdcc-user] Z80 code in RAM

2015-09-06 Thread Hynek Sladky
Thank You all for hints how to do this. The purpose is bank switching code for Z180; RAM is common area which has to be always mapped (stack, common variables), so this code has to be placed there. Hynek --

Re: [Sdcc-user] Z80 code in RAM

2015-09-04 Thread alvin albrecht
Let’s try that one more time seeing as that didn’t work... >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. Yes I think he has some self-modify

Re: [Sdcc-user] Z80 code in RAM

2015-09-04 Thread alvin albrecht
>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. Yes I think he has some self-modifying code that needs to be in a data section so that it is cop

Re: [Sdcc-user] Z80 code in RAM

2015-09-04 Thread Philipp Klaus Krause
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 theor

Re: [Sdcc-user] Z80 code in RAM

2015-09-04 Thread Alan Cox
> 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 f

Re: [Sdcc-user] Z80 code in RAM

2015-09-04 Thread Alan Cox
> I don't think we have any compiler support for that. So I recommend: > Use the -b flag for the linker to get the symbols for code in RAM, and > some tool such as objcopy to move it into ROM. Then in your main(), do a > memcpy() to move the code form ROM to RAM, and then call it. If you do then i

Re: [Sdcc-user] Z80 code in RAM

2015-09-04 Thread Alan Cox
On Fri, 04 Sep 2015 14:05:18 +0200 Hynek Sladky 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

Re: [Sdcc-user] Z80 code in RAM

2015-09-04 Thread Philipp Klaus Krause
On 04.09.2015 14:05, Hynek Sladky 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 b