This probably is more of a feature request than a
bug... but here goes.
When using mcs51 large memory model, local variables
are often not allocated to unused registers, which
leads to larger and slower code (and in the case of my
little mp3 player project, a lot more external MOVX bus
activity than necessary which temporarily suspend DMA
Here's a code sample from the project, separated into
a single self-contained file:
In this case, there are two 16-bit local variables
that are both allocated to external memory, even
though the compiler only uses 4 of the 8 registers.
When the code is compiled with small model, the
locals are allocated very nicely to registers, and
SDCC does a really nice job of packing it all into
just 6 registers instead of 8.
Is there any chance of getting this smarter register
usage ported from small to large model?
Log in to post a comment.