ARM Technical Support Knowledge Articles

XDATA PROBLEMS PORTING C51 CODE TO C251

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

I have a structure in xdata that has a bunch of unsigned chars and unsigned ints. The structure is at the address of a memory mapped I/O device.

The C51 compiler generates 2 MOVX instructions to access the unsigned ints and everything works OK.

The C251 compiler generates 2 MOV@DRk instructions to access the unsigned ints. This causes problems with my memory-mapped I/O.

Is there a way to force C251 to use the MOVX instructions? If not, how do I solve this problem?

ANSWER

There is no way to force C251 to use the MOVX instruction in this case. The best way to solve this problem is to change each unsigned ints to 2 unsigned chars and to write to each of these chars individually. This will generate code that works, is clearer, and is more portable.

Article last edited on: 2005-09-22 11:42:23

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