Keil Logo

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+0 Address+1 Address+2
Contents Memory Type High Byte Offset Low Byte Offset

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

Compiler Memory Type
idata data bdata xdata pdata code
C51 Compiler
(8051 Devices)
0x00 0x00 0x00 0x01 0xFE 0xFF
CX51 Compiler
(NXP 51MX Devices)
0x7F 0x7F 0x7F 0x00 0x00 0x80

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+0 Address+1 Address+2
Contents 0x01 0x12 0x34

Related Knowledgebase Articles

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.