Technical Support

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 <absacc.h>

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

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

SEE ALSO

MORE INFORMATION

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Friday, July 15, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure