[A83] Re: interrupt with shutdown


[Prev][Next][Index][Thread]

[A83] Re: interrupt with shutdown




You shouldn't need to.  The following is from mame-055/src/cpu/z80.c, line
2008:

#define EI {                          \
  /* If interrupts were disabled, execute one more      \
   * instruction and check the IRQ line.            \
   * If not, simply set interrupt flip-flop 2         \
   */                             \

That should avoid any race conditions where an interrupt would be called
after the ei and before the return.  Note that this is highly unlikely on
the calculator, and should not happen if you have a reasonable interrupt
handler.  In any case, it won't happen multiple times in a row, so you
should be safe.  If you have a handler that takes about as long as the
interrupt period, then yeah, maybe you should worry.  But really, it's a
moot point, considering most interrupt handlers.  If your interrupt handler
is taking that long, you'd better rethink what you are doing (or else you
really know what you are doing, and wouldn't be asking this).

> So then it's not that save to do an ei before my halt?






References: