# DeiMOS - A MOS 6502 superoptimizer

**URL:** <https://ziggit.dev/t/deimos-a-mos-6502-superoptimizer/14830>\
**Category:** Showcase\
**Tags:** optimization\
**Created:** [April 7, 2026, 12:17pm UTC](https://ziggit.dev/t/deimos-a-mos-6502-superoptimizer/14830 "2026-04-07T12:17:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aransentin](https://ziggit.dev/user_avatar/ziggit.dev/aransentin/32/8221_2.png) [@Aransentin](https://ziggit.dev/u/Aransentin)\
**Post date:** [April 7, 2026, 12:17pm UTC](https://ziggit.dev/t/deimos-a-mos-6502-superoptimizer/14830/1 "2026-04-07T12:17:24Z")

</div>

I wrote a superoptimizer for the MOS 6502. It generates programs up to 11 bytes long; perhaps more if you’re patient and/or have a particularly beefy computer.

There’s a writeup about it here: [DeiMOS](https://aransentin.github.io/deimos/)  
The code is available on GitHub, too: [GitHub - Aransentin/DeiMOS: A MOS 6502 superoptimizer · GitHub](https://github.com/Aransentin/DeiMOS)

---

<div class="post-metadata">

**Author:** ![mnemnion](https://ziggit.dev/user_avatar/ziggit.dev/mnemnion/32/2478_2.png) [@mnemnion](https://ziggit.dev/u/mnemnion)\
**Post date:** [April 7, 2026, 5:29pm UTC](https://ziggit.dev/t/deimos-a-mos-6502-superoptimizer/14830/2 "2026-04-07T17:29:51Z")

</div>

Hey, fascinating writeup. Welcome to the forum!

The examples have me thinking about what comes next. Shave a cycle off multiplying by ten? Sign me up, that’s a big deal in 6502 terms.

Maybe express objectives in BASIC? Then superoptimize each, patiently building up a collection of Weird Tricks for a compiler, which needs a big database of solved problems but is otherwise not that complex.

An 11 byte window is not big enough to generalize, I know. But ordinary optimization exists too.

Gave me something to think about anyway. Neat project!
