Keil™, An ARM® Company

Cx51 User's Guide

Generic and Far Pointers

Generic pointers have no declared explicit memory type. They may point to any memory area on the 8051. They are stored using three bytes (24 bits). The first byte contains a value that indicates the memory area or memory type. The remaining two bytes contain the address offset with the high-order byte first.

 Address+0Address+1Address+2
ContentsMemory TypeHigh Byte OffsetLow Byte Offset

Depending on the compiler version, the memory type byte has the following values:

CompilerMemory Type
idatadatabdataxdatapdatacode
C51 Compiler
(8051 Devices)
0x000x000x000x010xFE0xFF
CX51 Compiler
(NXP 51MX Devices)
0x7F0x7F0x7F0x000x000x80

The NXP 80C51MX architecture supports new MCU instructions that operate on a universal pointer. Universal pointers are identical with C51 generic pointers.

Values not specified in the table above access far memory. Generic pointers and far pointers have the same format.

Generic Pointer Example

The following example shows the memory storage of a generic pointer (on the C51 compiler) that references address 0x1234 in the xdata memory area.

 Address+0Address+1Address+2
Contents0x010x120x34

Related Knowledgebase Articles