Keil Logo

C51: VARIABLES IN LARGE AND COMPACT MEMORY MODEL DON'T WORK


Information in this article applies to:

  • C166 Version 3.12
  • C166 Version 4.01
  • C251 Version 2.14
  • C51 Version 5.50

SYMPTOMS

I have a project using an 8051 with 32KB external RAM. If I use SMALL memory model with some variable explicitly defined to use external data memory like:

int xdata aaa[100];

everything complies OK and works fine. But, if I use compact or large memory model, my program complies ok but the board just won't work.

CAUSE

All the memory model option controls is the default location of variables declared without a memory specifier. Small memory model will put unspecified variables in DATA, Compact uses PDATA, and Large uses XDATA. If your hardware is having trouble with builds under other memory models, chances are the board is not set up properly to handle the accesses you're now performing.

FORUM THREADS

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

Last Reviewed: Sunday, September 10, 2000


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.