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+0 | Address+1 |
|---|
| Contents | Offset (LSB) | Offset (MSB) |
The 2-bit DPP selector allows access to the following memory types:
DPP Selector Value | Memory Type |
|---|
| 0 | Unused in C166 near pointers. |
| 1 | NCONST group (objects defined with const near). |
| 2 | NDATA group (objects defined with near). |
| 3 | SDATA 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.
Related Knowledgebase Articles