> Am 16.09.2002 21:54:51, schrieb Galen Seitz <gal...@seitzassoc.com>: > >di...@eis.ru said: > >> Within ISR interrups are disabled unless you reenable it (with > >> enablenested attribute). > >> > >> For non-IRS: Yes, there is an attribute 'critical' (read doc.txt) > >> which does as follows: > >> > >> funct: > >> push r2 ; save status > >> dint ; disable ints > >> ...pushes > >> .... funct body follows > >> ...pops > >> reti ; restore r2 and return. > >> > > > >Isn't there a potential problem with this? If an interrupt occurs between > >the push r2 and the dint, and the interrupt routine returns with interrupts > >disabled, interrupts will get reenabled by the reti. Or is this a case of > >"don't do that"? > > true, but there is not simple solution to that. you must first save r2/SR > before disabling the interrupts and you can't check after dint if an irq > switched it off, cause dint did it.... > > so, you should not disable the GIE in an interrupt. however, you may > disable any individual interrupt sources through their respecitive IE bits. >
I figured this was the case, but I'm new to the instruction set, so I thought I might have missed an atomic test and set capability. BTW, what instruction is typically used for a breakpoint? I don't see an SWI or TRAP instruction. TIA, galen