ARM Technical Support Knowledge Articles

SROM MACROS RETURN INCORRECT ADDRESSES

Applies to: C51 C Compiler

Answer


Information in this article applies to:


SYMPTOM

When using the SROM macros to obtain addresses of source and target segments or classes, addresses returned may be truncated and therefore incorrect when using the small memory model.

CAUSE

This problem is caused by truncation of the address in the small memory model.

RESOLUTION

Addresses are not truncated in the large memory model or when the SROM definitions are modified to include an xdata type as follows:

#define SROM_PS(n)                                                        
extern unsigned char xdata _PR_##n##_S_;  /* segment start */             
extern unsigned char xdata _PR_##n##_E_;  /* segment end */               
extern unsigned char xdata _PR_##n##_L_;  /* segment len */               
extern unsigned char xdata _PR_##n##_T_;  /* segment target address */    
extern unsigned char xdata _PR_##n##_B_;  /* segment bank address */

#define SROM_MC(n)                                                        
extern unsigned char xdata _##n##_S_;     /* class start */               
extern unsigned char xdata _##n##_E_;     /* class end */                 
extern unsigned char xdata _##n##_L_;     /* class len */                 
extern unsigned char xdata _##n##_T_;     /* class target address */      
extern unsigned char xdata _##n##_B_;     /* class bank address */

STATUS

This problem will be corrected in the next release of the C51 Compiler.

SEE ALSO

Article last edited on: 2004-05-03 20:30:25

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