Skip to content

Enable --stack-auto for 8051 architecture

Jonathon Hall requested to merge stack-auto into master

Parameter allocation changed between sdcc 4.0 and 4.1/4.2, and it no longer fits into the 8051 internal RAM.

--stack-auto places all parameters/locals on the stack instead of allocating them statically in xdata. Most of the internal RAM can be used for stack in this configuration (0x21 - 0xff).

From testing, we currently reach a maximum stack top of 0xd8 - using 183/223 bytes, 40 bytes headroom. This is consistent between both sdcc 4.0 and 4.2.

From review, performance shouldn't see a major impact either way. Accessing locals/parameters appears to be much faster, but calling a function appears to be slower by roughly the same amount.

Stack overflow is a risk with --stack-auto, but we appear to have enough headroom.

Closes #21 (closed)

Signed-off-by: Jonathon Hall jonathon.hall@puri.sm

Merge request reports