ARM Technical Support Knowledge Articles

GENERATING A CALL TO AN ABSOLUTE MEMORY LOCATION

Applies to: C166 C Compiler

Answer


Information in this article applies to:


QUESTION

I need to call a routine at address 0x100000. Is there a way to do this in C?

ANSWER

Yes. The following statement generates call to a function at address 0x100000.

((void (far *) (void)) 0x100000) ();

The function called is a far function and must return with a RETS instruction. In the SMALL and COMPACT memory models, you must declare this function as a far function. For example:

void far func (void)  {
  // your code goes here
}

SEE ALSO

Article last edited on: 2007-06-26 11:39:08

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