This specifies a special calling convention for the __far keyword. Specify the __far keyword before the function identifier:
void __far f(void);
If the function returns a pointer, you must write the __far keyword before the first asterisk (" *").
int __far *f(void);
It must, however, be after the int and not before it.
For function pointers, many backends assume that the __far function pointer is pointing to functions with the __far calling convention, even when the calling convention is unspecified. Moreover, most backends do not support different function pointer sizes in one compilation unit. The function pointer size is then dependent only upon the memory model. See HC(S)08 Backend for details.
| Declaration | Allowed | Type Description |
|---|---|---|
| int __far f(); | OK | __far function returning an int |
| __far int f(); | error | |
| __far f(); | OK | __far function returning an int |
| int __far *f(); | OK | __far function returning a pointer to int |
| int * __far f(); | OK | Function returning a __far pointer to int |
| __far int * f(); | error | |
| int __far * __far f(); | OK | __far function returning a __far pointer to int |
| int __far i; | OK | Global __far object |
| int __far *i; | OK | Pointer to a __far object |
| int * __far i; | OK | __far pointer to int |
| int __far * __far i; | OK | __far pointer to a __far object |
| __far int *i; | OK | Pointer to a __far integer |
| int *__far (* __far f)(void) | OK | __far pointer to function returning a __far pointer to int |
| void * __far (* f)(void) | OK | Pointer to function returning a __far pointer to void |
| void __far * (* f)(void) | OK | Pointer to __far function returning a pointer to void |