Keil Logo

C166: Obtaining the Segment Offset of an SFR


Information in this article applies to:

  • C166 Version 4.03 and Later

QUESTION

I am trying to obtain the segment offset of an SFR. When I compile my project it generates an application error. I am using the intrinsic _sof_() function. What am I doing wrong?

ANSWER

The _sof_ function is not required for SFRs. Instead write something like:

DSTP0 = (unsigned int) &S0TBUF;     // S0TBUF is an SFR.

This will give you the segment offset for the SFR.

MORE INFORMATION

  • Refer to _sof_ in the C166 User's Guide.

Last Reviewed: Thursday, February 25, 2021


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.