+2003-09-15 Bernhard Held <bernhard@bernhardheld.de>
+
+ Feature req. 799831: added code to allow nesting of critical functions
+ * src/mcs51/gen.c (genFunction, genEndFunction)
+ * src/ds390/gen.c (genFunction, genEndFunction)
+
2003-09-14 Erik Petrich <epetrich@ivorytower.norman.ok.us>
* src/SDCCsymt.c (sclsFromPtr),
emitcode ("lcall","__stack_probe");
/* if critical function then turn interrupts off */
if (IFFUNC_ISCRITICAL (ftype))
- emitcode ("clr", "ea");
+ {
+ emitcode ("mov", "c,ea");
+ emitcode ("push", "psw"); /* save old ea via c in psw */
+ emitcode ("clr", "ea");
+ }
/* here we need to generate the equates for the
register bank if required */
emitcode ("pop", "acc");
if (IFFUNC_ISCRITICAL (sym->type))
- emitcode ("setb", "ea");
+ {
+ emitcode ("pop", "psw"); /* restore ea via c in psw */
+ emitcode ("mov", "ea,c");
+ }
/* if debug then send end of function */
if (options.debug && currFunc) {
else
{
if (IFFUNC_ISCRITICAL (sym->type))
- emitcode ("setb", "ea");
+ {
+ emitcode ("pop", "psw"); /* restore ea via c in psw */
+ emitcode ("mov", "ea,c");
+ }
if (IFFUNC_CALLEESAVES(sym->type))
{
/* if critical function then turn interrupts off */
if (IFFUNC_ISCRITICAL (ftype))
- emitcode ("clr", "ea");
+ {
+ emitcode ("mov", "c,ea");
+ emitcode ("push", "psw"); /* save old ea via c in psw */
+ emitcode ("clr", "ea");
+ }
/* here we need to generate the equates for the
register bank if required */
emitcode ("pop", "acc");
if (IFFUNC_ISCRITICAL (sym->type))
- emitcode ("setb", "ea");
+ {
+ emitcode ("pop", "psw"); /* restore ea via c in psw */
+ emitcode ("mov", "ea,c");
+ }
/* if debug then send end of function */
if (options.debug && currFunc)
else
{
if (IFFUNC_ISCRITICAL (sym->type))
- emitcode ("setb", "ea");
+ {
+ emitcode ("pop", "psw"); /* restore ea via c in psw */
+ emitcode ("mov", "ea,c");
+ }
if (IFFUNC_CALLEESAVES(sym->type))
{