Keil™, An ARM® Company

C166 User's Guide

near

The near memory type may be used for variables, constants, and functions. This memory is accessed using 16-bit addresses and may be on-chip or external.

  • For variables, near memory is limited to 16K, objects are limited to 16K, and objects may not cross a 64K boundary. Variables declared near are located in the NDATA group.
  • For constants (ROM variables), near memory is limited to 16K, objects are limited to 16K, and objects may not cross a 64K boundary. Constant variables declared near are located in the NCONST group.
  • For program code (functions), near memory is limited to 64K. Program code declared near is stored in the NCODE group. Functions are invoked with the CALLA or CALLR instruction.

Note

  • The DPPUSE linker directive may be used to extend the amount of memory available to the NDATA and NCONST groups to a total of 64K.

Declare near objects as follows:

unsigned char near near_variable;

unsigned char const near near_const_variable;

unsigned int near near_func (void)
{
return (0);
}