Pointer Qualifiers

Pointer qualifiers can be used to distinguish between different pointer types (e.g., for paging). Some of them are also used to specify the calling convention to be used (e.g., if banking is available).

Listing: Pointer qualifiers



__far  (alias 
far)


__near (alias 
near)

__paged

Far pointers contain a real RS08 address, that is, a linear address between 0 and 0x3FFF. A paged pointer is a 16-bit data entity containing a page number in the high byte and an address in the low byte. The address lies within the paging window, so no additional overhead is required to compute the value. Paged pointers cannot be used to access data across page boundaries. Use paged pointers whenever possible.

To allow portable programming between different CPUs (or if the target CPU does not support an additional keyword), you can include the defines listed below in the hidef.h header file.

Listing: far and near can be defined in the hidef.h file


#define far   /* no far keyword supported  */

#define near  /* no near keyword supported */