User`s guide

C for DSP56800E
User Stack Allocation
124
Targeting MC56F83xx/DSP5685x Controllers
asm(nop);}
#pragma check_inline_sp_effects on
int func()
{
int a=1, b=1, c;
if (a)
{
EnterCritical();
c = a+b;
}
else {
EnterCritical();
c = b++;
}
return (b+c);
}
This example will generate the following warning:
Warning : Cannot determine SP modification value at compile time
M56800E_main.c line 20 EnterCritical();
This example is not legal since the SP is modified by run-time dependent amount.
If all inline assembly modifications to the SP along all branches are equal approaching
the exit of a function, it is not necessary to explicitly deallocate the increased stack
space. The compiler “cleans up” the extra inline assembly stack allocation
automatically at the end of the function.
Listing 6.4 Example 4 – Automatic Deallocation of Inline Assembly Stack
Allocation
#pragma check_inline_sp_effects on
int func()
{
int a=1, b=1, c;
if (a)