_CALL_STAR08 what is this? how to avoid using a lib fuction ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

_CALL_STAR08 what is this? how to avoid using a lib fuction ?

2,089 Views
zoz
Contributor I
Can anybody tell me what does _CALL_STAR08 function do? It is located in ansiis.lib.
 
My compiled code uses this lib function and I don't want to do that. Is there any way to avoid using ansiis library functions in a code segment?
Labels (1)
0 Kudos
4 Replies

629 Views
CompilerGuru
NXP Employee
NXP Employee
That call runtime routine is used in order to call function pointers in certain cases and with certain arguments.
The main problem there is that for the argument passing, the compiler has to set certain registers, so he lacks them for evaluating and using the function pointer.
If do want this call to occur, do not use a function pointer or change the signature so that less/no registers are used. Or use inline assembly to make that particular call.

Daniel
0 Kudos

629 Views
zoz
Contributor I
Thank you so much Daniel!!!
Yes, the _CALL_STAR08 was called because I passed some arguments to a funciton pointer. Now I created global variables from the arguments and it works without _CALL_STAR08.
 
I am writing a firmware upgrade software for ZigBee devices. My software should not call any functions outside of my routines beacause I am rewriting the flash. That's why I was struggling with this.
 
Is there any documentation about the functions in ansiis.lib ?
 
Now I wrote
(page & 0x07FF) >> 7 where "page" is an unsigned short.
And _ILSR (ansiis.lib) is called! Do you know what is this and how can I write a workaround without calling _ILSR?
0 Kudos

630 Views
CompilerGuru
NXP Employee
NXP Employee
In the end the compiler will have to use runtime routines for certain C constructs.
For this particular case, optimizing for time (-ot) causes that the compiler inlines the runtime support function.
In general, with -ot the compiler does inline as much as he supports. There is a message which can be used so that the code wont compile if it contains a runtime call.
Use a
>#pragma MESSAGE ERROR C3605 // Runtime object _ILSR is used at PC 0x30
before the code starts and a
>#pragma MESSAGE DISABLE C3605

after the code which must not use runtime calls.


Daniel

Code:
// Configure C3605: Runtime object _ILSR is used at PC 0x30// as error.#pragma MESSAGE ERROR C3605 unsigned short page, res;void func(){    // Only compiles with -ot  res = (page & 0x07FF) >> 7;}

 


0 Kudos

630 Views
zoz
Contributor I
Thanks for your help, it worked.
And I have found an other workaround for this:smileysad:page & 0x07FF) >> 7;
I can simply split it: tmp = page & 0x07FF; tmp = tmp >> 7;
 
 
I know how to set -ot complier option, it is a global optimalisation. By the way, is there any way to set complier options locally for one particular segment of the code?
0 Kudos