Flat Mode - roybaer/sdcc-wiki GitHub Wiki

--model-flat24:

This option generates code for the 24 bit contiguous addressing mode of the
Dallas DS80C390 part. In this mode, up to four meg of external RAM or code
space can be directly addressed. See the data sheets at www.dalsemi.com for
further information on this part.

Note that the compiler does not generate any code to place the processor
into this mode (it defaults to 8051 compatible mode). Boot loader or similar
code must ensure that the processor is in 24 bit contiguous addressing mode
before calling the SDCC startup code.

Like the --model-large option, variables will by default be placed into the
XDATA segment. However, a current limitation is that the compiler will spill
variables into the DATA segment when it runs out of registers. This means
that compiling complex code can rapidly fill up the DATA segment. This
limitation is being worked on, and should be addressed in the next release
of sdcc.

Segments may be placed anywhere in the 4 meg address space using the usual
--*-loc options. Note that if any segments are located above 64K, the -r
flag must be passed to the linker to generate the proper segment
relocations, and the Intel HEX output format must be used. The -r flag can
be passed to the linker by using the option -Wl-r on the sdcc command line.

--stack-10bit:

This option generates code for the 10 bit stack mode of the Dallas DS80C390
part. In this mode, the stack is located in the lower 1K of the internal
RAM, which is mapped to 0x400000.

With this option, sdcc will generate the proper addressing for stack
variables.

Note that the support is incomplete, since it still uses a single byte as
the stack pointer. This means that only the lower 256 bytes of the potential
1K stack space can actually be used. However, this does allow you to reclaim
the precious 256 bytes of low RAM for use for the DATA and IDATA segments.

The compiler will not generate any code to put the processor into 10 bit
stack mode. It is important to ensure that the processor is in this mode
before calling any re-entrant functions compiled with this option.

In principle, this should work with the --stack-auto option, but that has
not been tested. It is incompatible with the --xstack option. It also only
makes sense if the processor is in 24 bit contiguous addressing mode (see
the --model-flat24 option).
⚠️ **GitHub.com Fallback** ⚠️