<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/github---mindbox77-zxdesk-a-gui-operating-system-for-the-48k-zx-spectrum-in-z80-assembly-6pjwfvgog" -->

---
title: GitHub - mindbox77/zxdesk: A GUI operating system for...
description: A full GUI desktop environment built from scratch in Z80 assembly for the 48K ZX Spectrum, featuring overlapping windows, menus, a heap, event queue, swappable...
canonical: https://daily.dev/posts/github---mindbox77-zxdesk-a-gui-operating-system-for-the-48k-zx-spectrum-in-z80-assembly-6pjwfvgog
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: GitHub - mindbox77/zxdesk: A GUI operating system for the 48K ZX Spectrum, in Z80 assembly | daily.dev
og:description: A full GUI desktop environment built from scratch in Z80 assembly for the 48K ZX Spectrum, featuring overlapping windows, menus, a heap, event queue, swappable...
og:url: https://daily.dev/posts/github---mindbox77-zxdesk-a-gui-operating-system-for-the-48k-zx-spectrum-in-z80-assembly-6pjwfvgog
og:image: https://api.daily.dev/og/posts/6PJwFVgOg.png
og:image:alt: GitHub - mindbox77/zxdesk: A GUI operating system for the 48K ZX Spectrum, in Z80 assembly
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub - mindbox77/zxdesk: A GUI operating system for the 48K ZX Spectrum, in Z80 assembly

**[Two Stop Bits](https://daily.dev/sources/twostopbits)** · 28 min read · 0 upvotes · 0 comments

## Summary

A full GUI desktop environment built from scratch in Z80 assembly for the 48K ZX Spectrum, featuring overlapping windows, menus, a heap, event queue, swappable storage backends, and bundled applications, all running on real 1982 hardware within a single interrupt frame. The write-up documents dozens of hardware measurements: contention actually costs 14.7% rather than the folklore 50%, an interrupt-loss bug caused by holding DI during stack-based screen fills, a heap corruption bug that silently self-healed, and the four optimizations that got window dragging from 25Hz to a full 50Hz frame rate. It also covers a Fuse emulator bug where Kempston mouse movement freezes during button-hold drags.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://github.com/mindbox77/zxdesk>

## Questions this post answers

### Why does dragging a window freeze when I hold the mouse button in Fuse on macOS?

Fuse for macOS version 1.9.2 stops delivering Kempston mouse movement events while a mouse button is held down, so the pointer freezes the instant a drag begins. The mouse buttons themselves register correctly and movement works fine otherwise; only movement during a held button fails. A workaround is holding space bar instead of the mouse button while dragging, since a real Kempston mouse drags normally without this issue.

_Anyone chasing emulator-only bugs on retro hardware projects can compare notes on daily.dev before blaming their own code._

### How much does ULA memory contention actually slow down screen writes on a ZX Spectrum 48K, compared to the commonly cited 50% penalty?

Measured directly on hardware, contended memory writes cost about 14.7% more time, roughly 1.7 T states per contended byte, not the 50% figure widely repeated in Spectrum folklore. A 1,024 byte fill swept across a frame took 11,744 T states in the uncontended border versus a worst case of 13,473 T states inside the contended display area, meaning budgets built on the 50% assumption are roughly a third too conservative.

_Developers optimizing for constrained retro hardware can track hard-won timing figures like this on daily.dev instead of trusting folklore._

### Why would disabling interrupts (DI) during a screen fill routine on a Z80-based ZX Spectrum cause dropped frames instead of delayed ones?

The Spectrum only asserts the INT signal for 32 T states before withdrawing it, so if a DI region covers that 32 T window the interrupt is destroyed entirely rather than merely postponed, and re-enabling interrupts afterward cannot recover it. Testing with an interrupt injected after every instruction showed the interrupt was refused at 458 of 500 boundaries in one fill routine. The fix was restructuring the fill to run with interrupts enabled throughout, making the push chain one shorter than the row so the return address lands only on bytes about to be overwritten anyway.

_Low-level Z80 developers debugging timing-sensitive interrupt loss can find this kind of hardware-level detail on daily.dev._

## Similar posts on daily.dev

- [The Sinclair Spectrum Gets A Desktop GUI](https://daily.dev/posts/the-sinclair-spectrum-gets-a-desktop-gui-rhfydhzpm) · Hackaday · 0 upvotes · 0 comments
- [Writing a Demoscene Intro for the ZX Spectrum](https://daily.dev/posts/writing-a-demoscene-intro-for-the-zx-spectrum-soktnr58t) · Lobsters · 0 upvotes · 0 comments
- [os8088 -- a Mac-style GUI OS for the IBM PC XT](https://daily.dev/posts/os8088----a-mac-style-gui-os-for-the-ibm-pc-xt-5eeukkqfl) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#assembly](https://daily.dev/tags/assembly)

[View this post on daily.dev](https://daily.dev/posts/github---mindbox77-zxdesk-a-gui-operating-system-for-the-48k-zx-spectrum-in-z80-assembly-6pjwfvgog)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"GitHub - mindbox77/zxdesk: A GUI operating system for the 48K ZX Spectrum, in Z80 assembly","url":"https://daily.dev/posts/github---mindbox77-zxdesk-a-gui-operating-system-for-the-48k-zx-spectrum-in-z80-assembly-6pjwfvgog","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/github---mindbox77-zxdesk-a-gui-operating-system-for-the-48k-zx-spectrum-in-z80-assembly-6pjwfvgog"},"datePublished":"2026-09-21T22:52:01.882Z","dateModified":"2026-09-21T22:52:28.359Z","description":"A full GUI desktop environment built from scratch in Z80 assembly for the 48K ZX Spectrum, featuring overlapping windows, menus, a heap, event queue, swappable...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c5578adc3b5ae9e9e71f9b9d10b21549?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c5578adc3b5ae9e9e71f9b9d10b21549?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Two Stop Bits","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Two Stop Bits","logo":"https://media.daily.dev/image/upload/s--BScjOU_Q--/f_auto/v1728977574/logos/twostopbits","url":"https://daily.dev/sources/twostopbits"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/github---mindbox77-zxdesk-a-gui-operating-system-for-the-48k-zx-spectrum-in-z80-assembly-6pjwfvgog","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,assembly","timeRequired":"PT28M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Two Stop Bits","item":"https://daily.dev/sources/twostopbits"},{"@type":"ListItem","position":3,"name":"GitHub - mindbox77/zxdesk: A GUI operating system for the 48K ZX Spectrum, in Z80 assembly"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/github---mindbox77-zxdesk-a-gui-operating-system-for-the-48k-zx-spectrum-in-z80-assembly-6pjwfvgog#faq","mainEntity":[{"@type":"Question","name":"Why does dragging a window freeze when I hold the mouse button in Fuse on macOS?","acceptedAnswer":{"@type":"Answer","text":"Fuse for macOS version 1.9.2 stops delivering Kempston mouse movement events while a mouse button is held down, so the pointer freezes the instant a drag begins. The mouse buttons themselves register correctly and movement works fine otherwise; only movement during a held button fails. A workaround is holding space bar instead of the mouse button while dragging, since a real Kempston mouse drags normally without this issue. Anyone chasing emulator-only bugs on retro hardware projects can compare notes on daily.dev before blaming their own code."}},{"@type":"Question","name":"How much does ULA memory contention actually slow down screen writes on a ZX Spectrum 48K, compared to the commonly cited 50% penalty?","acceptedAnswer":{"@type":"Answer","text":"Measured directly on hardware, contended memory writes cost about 14.7% more time, roughly 1.7 T states per contended byte, not the 50% figure widely repeated in Spectrum folklore. A 1,024 byte fill swept across a frame took 11,744 T states in the uncontended border versus a worst case of 13,473 T states inside the contended display area, meaning budgets built on the 50% assumption are roughly a third too conservative. Developers optimizing for constrained retro hardware can track hard-won timing figures like this on daily.dev instead of trusting folklore."}},{"@type":"Question","name":"Why would disabling interrupts (DI) during a screen fill routine on a Z80-based ZX Spectrum cause dropped frames instead of delayed ones?","acceptedAnswer":{"@type":"Answer","text":"The Spectrum only asserts the INT signal for 32 T states before withdrawing it, so if a DI region covers that 32 T window the interrupt is destroyed entirely rather than merely postponed, and re-enabling interrupts afterward cannot recover it. Testing with an interrupt injected after every instruction showed the interrupt was refused at 458 of 500 boundaries in one fill routine. The fix was restructuring the fill to run with interrupts enabled throughout, making the push chain one shorter than the row so the return address lands only on bytes about to be overwritten anyway. Low-level Z80 developers debugging timing-sensitive interrupt loss can find this kind of hardware-level detail on daily.dev."}}]}
```

