However, I have run the following code on Fuse:
Code: Select all
EI ; T=69884
DEFS N,0xFB ; T=69888; N 'EI' instructions blocking interrupts
NOP ; T=69888+N*4
Code: Select all
EI ; T=69884
DEFS N,0xFB ; T=69888; N 'EI' instructions blocking interrupts
NOP ; T=69888+N*4
If that means an interrupt can be accepted within 0-31 T-states of a frame boundary, but not after that, then that seems to agree with my Fuse experiment. Thanks!
A Z80 interrupt must not be held active for longer than is necessary as this may lead to the Z80 responding to it multiple times. It is documented somewhere that the ZX Spectrum holds the interrupt active for 32 T-states, which is long enough for all instructions to have time to respond to it, but is still long enough for it to be detected more than once.
yes. that's what all documentation says, at least, and what most emulators implement. it may be slightly different on clones, though.
According to p. 226 of Chris Smith's excellent book "The ZX Spectrum ULA : How to design a microcomputer" the ULA pulls the /INT pin low for exactly 32 T-states.
Ooh, I didn't think of that. And sure enough, Fuse does indeed run an 'EI: NOP' interrupt service routine twice.
You know, I might have come across something like that while searching for the answer to this question, but I wouldn't have understood what it meant in practical terms. I'm just not really a hardware person.
Same here. I have always had the bliss of not having to think about /what/ generates an interrupt. Until now, it was just one of those things that occurred once a frame. I had not considered /what/ was generating that interrupt. My naive knee jerk thought it was the Z80. Duh, of course not.
In which case I can recommend watching - even though not for the Z80 - the complete control of the CPU was really pleasing and educational.