Keil Logo

C51: Far Data Pointer Boundaries


Information in this article applies to:

  • C51 All Versions

SYMPTOM

When I try to access a large data buffer using a far pointer, the pointer won't increment over a 64k boundary.

CAUSE

The far data pointer type is only 16 bits long, so it can only "see" 64k of space.

RESOLUTION

There is no pointer type, in C51, that can see more than 64k of data space at a time. However, there are ways around this. For example:

#include

unsigned char far *farBuff = FARRAY(unsigned char, 0x110000);
unsigned long i;

for (i=0; i<0x18000; i++)
{
  userFunc(farBuff[i]);
}

SEE ALSO

MORE INFORMATION


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  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.