4 ms·
As other people have said, there's an NMI line. But that's not usually how it's implemented because you tend to want to mask it if the thing is doing a real tim
by baz00 3y ago
As other people have said, there's an NMI line. But that's not usually how it's implemented because you tend to want to mask it if the thing is doing a real time or time critical task. The Z80 CTC was the canonical solution.
Back in the dark ages had an "OS" which had a simple "task table". This was a circular linked list with enough space after each pointer to store the CPU state for a task and some stack. There was one element per task. The task interrupt would fire every 100ms, the registers/stack pointer/PC would be dumped to that, the list followed and the next task picked up and loaded into the CPU, then it'd return from interrupt and off it'd go again. You could call YIELD at any point if you didn't want the rest of your time slice. If you had something that needed to handle an interrupt from the CTC or an NMI, it would disable interrupts until it was done.
Notably you didn't tend to create new tasks. They were hard coded in at assembly time!
Edit: we also had an 8031 version as well.
- andyjohnson0 3y agoThanks. Back when I last wrote an z80 asm I didn't have access to an environment with anything like an os. > Notably you didn't tend to create new tasks. They were hard coded in at assembly time! Reminiscent of the "executive" in the Apollo lunar module computer.