Z80 Multitasking Proof of Concept: Simulating Task Switching for Up to Eight Concurrent Tasks
By
chorlton2080
A second-rack bagel that's nearly first-rack. Tasty stuff.
Summary
This article describes a proof-of-concept multitasking program for the Z80 processor that can run up to eight separate tasks simultaneously. The program works by saving CPU registers to a task's stack during interrupts, then swapping to the next task's stack pointer. The article notes limitations including task stack size constraints, maximum task count, and performance degradation as more tasks are loaded.
Key quotes
· 4 pulledThis 'Proof of concept' program simulates task multitasking that can run up to eight separate tasks at the same time.
When the CPU triggers an interrupt, CPU registers are saved onto the task's stack, then the next task stack is swapped into the stack pointer.
This code does have limitation in particular the size of the task stacks and the number of tasks.
Also, the more tasks loaded, the slower each task goes.
You might also wanna read
BasiliskII Macintosh 68k Emulator Ported to ESP32-P4 for M5Stack Tab5 Hardware
This article describes a technical project that ports the BasiliskII Macintosh 68k emulator to the ESP32-P4 microcontroller, specifically ru
rePalm Project: Porting PalmOS to Modern Hardware and Pixter Device Development
rePalm is a technical project focused on running PalmOS on modern hardware, specifically targeting the Pixter device. The content documents
Tiny386 Emulator Runs Windows 95 on ESP32-S3 Microcontroller
Developer He Chunhui has created Tiny386, an x86 PC emulator that runs on the ESP32-S3 microcontroller, enabling it to boot and run Microsof
Pico-286: RP2040/RP2350-Based 286 PC Emulator for Retro Computing
The Pico-286 project is an open-source emulator that recreates a classic 286 PC system from the late 80s/early 90s on Raspberry Pi Pico micr
wolfCOSE: A Lightweight COSE + CBOR Library for Embedded Systems with PQC and FIPS 140-3 Support
wolfCOSE is a lightweight C library implementing CBOR (RFC 8949) and COSE (RFC 9052/9053) for embedded systems, using wolfSSL as the crypto
ZX Spectrum BASIC interpreter rebuilt from scratch to run natively in web browsers
A developer has rebuilt the ZX Spectrum's BASIC interpreter from scratch to run in a web browser, without emulating the original Z80 hardwar
