near/far function (#pragma near/#pragma far) [V1.05 or later] |
This notifies the compiler of a function that is specified with __near/__far.
Address reference of a function specified with #pragma near always returns a near pointer and the function is allocated to a section with the relocation attribute TEXT.
For details on __near, refer to "Specifying memory allocation area (__near /__far)".
Address reference of a function specified with #pragma far always returns a far pointer and the function is allocated to a section with the relocation attribute TEXT.
For details on __far, refer to "Specifying memory allocation area (__near /__far)".
A function specified with #pragma near ignores the keyword without a warning being output even for a function to which the __callt or __far keyword is added. |
To use the function as a callt function, specify #pragma callt instead of #pragma near for the function.
A function specified with #pragma far ignores the keyword without a warning being output even for a function to which the __callt or __near keyword is added. |
When #pragma callt, #pragma near, or #pragma far was specified together for the same function, the #pragma directives become valid in the priority order of #pragma callt > #pragma near > #pragma far. |
If there are multiple declarations for the same variable and #pragma near/#pragma far is written at the location where the second or subsequent declaration takes effect, correct operation is not guaranteed. Declare #pragma near/#pragma far before the first declaration. |
If a #pragma directive other than #pragma callt, #pragma near, or #pragma far is specified for the same function, a compilation error will occur. |
If __inline is specified in the declaration of a target function of this #pragma directive, a compilation error will occur. |
The __far keyword cannot be used together with the __callt keyword or __near keyword, and a compilation error will occur if used so. |