ARM Technical Support Knowledge Articles

FAR DATA POINTER BOUNDARIES

Applies to: C51 C Compiler

Answer


Information in this article applies to:


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

Article last edited on: 2005-07-15 10:10:22

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential