ARM Technical Support Knowledge Articles

OBTAINING THE SEGMENT OFFSET OF AN SFR

Applies to: C166 C Compiler

Answer


Information in this article applies to:


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

Article last edited on: 2005-07-15 13:12:31

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