A desktop inside 48 kilobytes
An independent developer has released ZXDesk, a graphical desktop built for the original 48K ZX Spectrum and written in Z80 assembly. The open-source project implements a windowed environment on hardware launched in 1982, fitting its code and working data within the machine's sharply constrained memory.
ZXDesk includes overlapping windows with focus and stacking order, pull-down menus, dialog boxes, controls and an event queue. Its bundled applications include a notepad, clock, calendar, settings panel and two-pane file manager. The developer says the software runs on physical Spectrum hardware as well as emulators and can move a window within one 69,888 T-state display frame.
The project is not presented as a port of Digital Research's GEM desktop. Instead, its creator describes it as an attempt to capture the experience of a persistent graphical workspace while adapting every component to a 3.5MHz processor, 48KB of RAM and the Spectrum's unusual display layout. The work completes an idea the developer began exploring in the 1980s.
Architecture shaped by hardware limits
Several design choices expose how much engineering is required to make a desktop responsive on this machine. A device layer isolates higher-level code from the Spectrum screen's interleaved memory. The main loop synchronizes work with the display interrupt, performs pointer processing in the border period and redraws moved windows on a carefully timed schedule. A 16-slot ring buffer turns raw input into pointer, button and keyboard events.
Temporary screen regions use a small stack of saved surfaces so menus and windows can be restored. Window records double as the source for paint order and hit testing, reducing duplicated state. Storage support is organized as a registry of interchangeable backends, with patched jump instructions keeping dispatch overhead low. Controls share a compact row-based representation, allowing settings, file lists and save dialogs to use the same underlying code.
The repository also documents defensive limits. The heap ends at address FF00 rather than the top of memory, sacrificing 256 bytes to avoid address wraparound during block traversal. Build checks prevent code from silently growing into a screen-grab buffer. A scripted-input mode replays identical interactions so timing and visual changes can be compared between builds.
Building ZXDesk requires the Pasmo assembler and separately obtained emulator and esxDOS components that the author does not redistribute. The detailed repository is therefore both a usable retro-computing project and an engineering record of creating modern interface conventions under early-1980s constraints.



