I had a look at bug reports https://sourceforge.net/p/sdcc/bugs/2131/
and https://sourceforge.net/p/sdcc/bugs/2339/ and section "3.8.4 Z80
Interrupt Service Routines" in the manual.

According to the manual, we have:
1) non-interruptible isr (can be interrupted by nmi only):
void i1(void) __interrupt
2) interruptible isr (can be interrupted by any interupt)
void i2(void) __critical __interrupt(0)
3) nmi handler (can be interrupted by nmi only)
void i3(void) __critical __interrupt

We generate code:
1)
save regs
...
restore regs
reti
2)
di
save regs
...
restore regs
ei
reti
3)
save regs
...
restore regs
retn

Out of these, 3) looks correct to me. But 1) fails to reenable
interrupts at the end (I think there should be an ei before the reti).
And 2) is completly wrong, I think it should be:
ei
save regs
...
restore regs
reti

Did I miss something?

Philipp
(who so far always wrote his interrupt handlers in asm instead of using
the SDCC-provided facilities)


Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to