interrupts and VDP access

Page 2/2
1 |

Par santiontanon

Paragon (1734)

Portrait de santiontanon

16-07-2018, 16:06

Metalion wrote:
santiontanon wrote:

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...

Par Grauw

Ascended (10679)

Portrait de Grauw

16-07-2018, 17:16

Dolphin101546015 wrote:

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!

Par Louthrax

Prophet (2435)

Portrait de Louthrax

16-07-2018, 20:14

That latched register write value really tied the VDP together Running Naked in a Field of Flowers (sorry, had to make a Big Lebowski related joke here...)

Par Dolphin101546015

Champion (335)

Portrait de Dolphin101546015

16-07-2018, 22:29

Grauw wrote:
Dolphin101546015 wrote:

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!

Question
Ok, no problems. I just not understand, why you explain me thats i told before.

Par ARTRAG

Enlighted (6914)

Portrait de ARTRAG

17-07-2018, 08:14

Yes, bios always save all z80 registers in the Isr and restore them before returning to the interrupted code

Par Sepulep

Resident (36)

Portrait de Sepulep

17-07-2018, 11:38

@grauw, @santiontanon, thanks btw guys for the awesomely impressive work on the glass assembler and ToP (and the very nice blogpost about it!!)

Par Grauw

Ascended (10679)

Portrait de Grauw

17-07-2018, 14:07

santiontanon wrote:

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...

Par santiontanon

Paragon (1734)

Portrait de santiontanon

17-07-2018, 16:47

@Sepulep: Thanks! Big smile 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! Smile

Page 2/2
1 |