2.6.6 Relationship with near and far

The near/far attribute of data and functions is determined by options and keywords.

The following shows how to determine the near/far attribute.

 

Option Or Keyword

How to Determine near/far Attribute

Priority

(a)

-cpu

This option determines the default near/far attribute.

1

(b)

-memory_model

This option overwrites the default near/far attribute determined by (a).

2

(c)

-far_rom

Only for ROM data, this option overwrites the near/far attribute determined by (b) with the far attribute.

3

(d)

__near/__far

These settings are not affected by (a) to (c); the __near and _far specifications are valid.

4

 

For (b) and (c) in the above table (-memory_model and -far_rom options), the following shows the near/far attribute determined for ROM data and RAM data when only the former option is specified and when both options are specified.

type Value Specified in -memory_model=type

-far_rom Specification

Function

ROM Data

RAM Data

small

Not specified

near

near

near

medium

far

near

near

small

Specified

near

far

near

medium

far

far

near