Keil™, An ARM® Company

C166 User's Guide

near Pointers

Pointers to near objects are stored using two bytes (16 bits). The bytes are stored little endian or low to high order. In the tiny memory model, near pointers contain a 16-bit memory address. In all other memory models, near pointers contain a 14-bit offset in bits 0-13 and a 2-bit DPP selector in bits 14 and 15.

A near pointer is stored in memory at a word boundary as follows:

 Address+0Address+1
ContentsOffset (LSB)Offset (MSB)

The 2-bit DPP selector allows access to the following memory types:

DPP
Selector
Value
Memory Type
0Unused in C166 near pointers.
1NCONST group (objects defined with const near).
2NDATA group (objects defined with near).
3SDATA or SYSTEM group (objects defined with sdata, idata, or bdata).

You may use the L166 Linker DPPUSE directive to manually configure the DPP register assignments.