Nothing is restored after an interrupt as far as I know, not even the Z80 state. It is up to the interrupt code to save and restore register status.
No, that's incorrect. At 0038h, all registers (even alternate ones) are saved to stack before calling the interrupt hook. And they are restored after returning from it.
Are you sure all MSX bios's do this? (I can see C-BIOS does it: https://sourceforge.net/p/cbios/cbios/ci/master/tree/src/mai... ), but in my experience, if I don't push/pop the registers myself manually in my interrupt code (when putting it in H.TIMI, for example), everything breaks...
Dude, and now please read all my messages above.
Dear dude, if you don't want my responses, then you've just gotten your way!
That latched register write value really tied the VDP together (sorry, had to make a Big Lebowski related joke here...)
Dude, and now please read all my messages above.
Dear dude, if you don't want my responses, then you've just gotten your way!
Ok, no problems. I just not understand, why you explain me thats i told before.
Yes, bios always save all z80 registers in the Isr and restore them before returning to the interrupted code
@grauw, @santiontanon, thanks btw guys for the awesomely impressive work on the glass assembler and ToP (and the very nice blogpost about it!!)
Are you sure all MSX bios's do this? (I can see C-BIOS does it: https://sourceforge.net/p/cbios/cbios/ci/master/tree/src/mai... ), but in my experience, if I don't push/pop the registers myself manually in my interrupt code (when putting it in H.TIMI, for example), everything breaks...
That’s strange, should not be needed at all... In H.KEYI nothing needs to be preserved, and in H.TIMI you only need to preserve AF because otherwise the status register mirror doesn’t update correctly. But omitting that won’t usually lead to problems, and either way all registers are preserved and restored by the ISR on entry and exit (I believe unlike the CPC which does modifies EX registers).
https://sourceforge.net/p/msxsyssrc/git/ci/master/tree/base1...
@Sepulep: Thanks! will try to keep it up!
@Grauw: Ok, strange indeed. I'll investigate a bit more, maybe I'm doing something wrong. But if what you guys say is true, then I can save a few bytes/CPU ticks, which is great too!