Motorola DSP56800 Guía de usuario Pagina 124

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 446
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 123
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)
Vista de pagina 123
1 2 ... 119 120 121 122 123 124 125 126 127 128 129 ... 445 446

Comentarios a estos manuales

Sin comentarios