Technical Support

C51: XDATA PROBLEMS PORTING C51 CODE TO C251


Information in this article applies to:

  • C251 All Versions

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.

Last Reviewed: Thursday, September 22, 2005


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