- Joined: 23 Aug 2009
- Posts: 213
- Location: Seattle, WA
|
Block instructions (OTIR, LDIR, etc.) and interrupts
Posted: Mon Aug 12, 2019 10:44 pm
|
How well do interrupts play with block load instructions, such as OTIR/LDIR, etc.?
The official Z80 docs indicate that interrupts should happen seamlessly between individual loads in a long-running block operation, but I'm curious how that fares in actual practice. For example, do you run the risk of having a block operation fail if a VBLANK occurs in the middle of one?
The official Sega docs say the following:
Quote The VDP chip cannot process data any faster than the following rates:
16 Z80A T-States during VBLANK
29 Z80A T-States during active video.
This means that you should never issue two consecutive OUT or IN instructions to the VDP; they should be separated by at least a NOP instruction.
...but I've never known if those were legit or not.
|
- Site Admin
- Joined: 19 Oct 1999
- Posts: 14732
- Location: London
|
Posted: Tue Aug 13, 2019 7:32 am
|
During VBlank the VDP timing constraints are below the speed the Z80 can access it.
The block instructions work executing the same address once per byte, allowing interrupts after each iteration. The interrupt would disrupt the operation if it did not restore state before returning.
|