
(Image Credit: Growtike/Unsplash)
You might think it is impossible to emulate an x86 processor using a web-based stylesheet language. Estonia-based infosec coder Lyra Rebane managed to pull that off in CSS without using JavaScript, WASM, or any other runtime. She plans to publish a blog post soon describing the technical details that went into this project.
Her x86 emulator tackles basic instructions, including MOV, ADD, and JMP. In addition, it features a display, a keypad, and preinstalled software that calculates the Fibonacci sequence, Pascal’s triangle, and a Wordie variation. However, those who want to try it out will require the latest Chromium-based browser version since some CSS features used in this project remain non-standard. Rebane also shows others how to use the gcc-ia16 compiler to compile C applications for the emulator.
Rebane coded the emulator on her own, which means she didn’t use AI assistance or vibe-coding. She even mentioned an AI bot can’t develop such a project as it demands radical logical contortions to coerce CSS into functioning as a complete state machine. Rebane gave credit to Jane Ori’s CSS CPU hack as a source of inspiration for her project.
Sadly, this emulator cannot run Doom. It doesn’t have port input/output, interrupt handling, and block-operation instructions---key functionalities for games. It’s also worth noting that Doom only runs on a 32-bit CPU, 4MB of RAM, and must enter protected mode. This emulator is sadly 16-bit, like the original 8086. But, that shouldn’t stop the ambitious.
Have a story tip? Message me here at element14.