Keil Logo

C51: ASSIGNING AN I/O ADDRESS TO A VARIABLE

QUESTION

How do I assign a variable to a specific memory location, an I/O address, using µVision?

ANSWER

You may use one of the following methods to assign a specific address to a variable.

  1. Use the _at_ keyword when you declare the variable.
  2. Use the Absolute Access Macros defined in ABSACC.H in \C51\INC.
  3. Use the CODE, XDATA, BIT, and other directives in the BL51 linker to locate a SEGMENT at a particular address.

All three of these methods are discussed in detail in the C51 Compiler User's Guide.

MORE INFORMATION

Last Reviewed: Friday, September 16, 2005


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.