Hello Maarten,

Ahaa..., many thanks for this explanation of 'spilled location'. As I
still often use assembler on the 51 I know that working with external
memory is an expensive task to do for the processor. If it would just
be a question of speed then there would be no problem (silabs running
at 100Mhz today) but I know that the problem mainly consist of moving
data from one location to another.
Just one final question: would you then agree to the somewhat generic
statement that sdcc would do much better in allocating memory if it is
told how to do so, i.e. if I put some variables deliberately into DATA
instead of telling sdcc by the model large to allocate everything in
XDATA?

thanks again, Felix

-------------------------

Felix

Maarten Brock wrote:

> Felix,

> It's a bit more complicated than what's written in the 
> manual but the basics are correct. When using large 
> memory model and no reentrancy all automatics are placed 
> in xdata by default. But xdata is expensive to use, 
> because everything must be done through the accumulator 
> and data pointer. Consider a simple addition:
> x = y + z;
> SDCC must get y from xdata into ACC and temporarily 
> store it somewhere because it needs ACC again to get z 
> from xdata. SDCC tries to store it in a register, but 
> when it needs to remember a lot of those, the registers 
> are used up and it reverts to using spill locations in 
> DATA. When it has taken z into ACC it can add y to it 
> and finally store ACC to x.
> Now what if y which was spilled to data never really 
> gets used without the spill location? Then there no 
> longer is any reason to allocate memory for it in XDATA! 
> So SDCC ends up renaming the spill location sloc to the 
> real name y.

> When using large memory model SDCC might need alot of 
> those spill locations and they can fill up all data 
> memory without having one single variable put there by 
> the user. The fact that SDCC is not good at overlaying 
> only makes this worse.

> Maarten







-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to