Skip to main content

IAR Embedded Workbench for RL78 5.20

Code models and memory attributes for function storage

In this section:

Use code models to control how the compiler generates code for an application.

Your project can only use one code model at a time, and the same model must be used by all user modules and all library modules. All code models produce code that is ROMable. The code model also specifies a default memory range for storing the functions.

Note

Your choice of code model does not affect the placement of data.

These code models are available:

Code model name

Description

Near (default)

Function calls reach the first 64 Kbytes of memory

Far

Function calls reach the entire 1 Mbyte memory

Table 56. Code models


If you do not specify a code model, the compiler will use the Near code model as default.

Caution

See Target options for information about specifying a code model in the IDE.

Danger

Use the ‑‑code_model option to specify the code model for your project; see --code_model.