User manual
Project creation and build UM0036
96/385 Doc ID 7705 Rev 11
General settings for Cosmic toolset
With the category set to General, you can access the following standard settings and
options:
● Compiler memory models
● Debug information
● Optimizations
● Compiler messages display
● C language
● Listings
● Preprocessor definitions
● User-defined options
Compiler memory models
You can choose to compile your application according to one of the predefined memory
models that can help you optimize your code’s size and performance. These models tell the
compiler how the stack is used and where the stack, global variables and pointers are
located in the memory.
Table 31 and Table 32 provide a summary of the memory model options for ST7 and STM8
microcontrollers.
Table 31. Cosmic C compiler memory models for ST7
Memory model
(1)
Stack type and location
Location of global
variables
(2)
Location of pointers
(2)
Small memory
(+modms)
Simulated in Short range
memory
Long range memory Long range memory
Medium memory (+modmm)
Simulated in Long range
memory
Short range memory Long range memory
Long memory
(+modml)
Simulated in Long range
memory
Long range memory Long range memory
Short memory
(+modm) (Default)
Simulated in Short range
memory
Short range memory Long range memory
Compact memory (+modc)
(ST7 only)
Simulated in Short range
memory
Short range memory Short range memory
Long stack
(+modsl)
Physical stack in Long
range memory
Long range memory Long range memory
Short stack
(+mods)
Physical stack in Long
range memory
Short range memory Long range memory
1. For complete descriptions of memory models, refer to the C Cross Compiler User’s Guide
2. Short range means the variable is stored on one byte. Long range means the variable is stored on two bytes.