Yahoo
Advertisement
Advertisement
Advertisement
Advertisement

Enterprising developer somehow writes an x86 CPU emulator in plain CSS — no Javascript, no WASM, just stylesheet computing

When you buy through links on our articles, Future and its syndication partners may earn a commission.

Hashes.

Credit: Getty

Yes, you did read the headline correctly, and you'd be wise to fetch a cross, garlic, and a stake. Lyra Rebane, a madlady who dabbles in CSS and infosec, figured out she could leverage the power of contemporary implementations of the stylesheet language to emulate an x86 processor , all without even a single line of JavaScript, WASM, or any other such tomfoolery.

Go deeper with TH Premium: CPU

A hand holding the Ryzen 7 9850X3D.

(Image credit: Tom's Hardware)

Advertisement
Advertisement

The emulator even comes complete with a basic display and keypad, and some preinstalled programs for calculating the Fibonacci sequence, Pascal's triangle, and a variation of Wordle. You'll need a recent version of a Chromium-based browser, as some CSS features she used are not yet standard. Rebane even goes as far as showing fellow mad-people how to compile their own C programs for the emulator using the gcc-ia16 compiler.

As the first question out of everyone's mouths will be "Can it run Doom?", the answer is that no, it cannot, or at least not yet. While the x86css emulator implements most of the x86 assembly, it's missing key functionality like interrupt handling, port input/output, and block-operation instructions, all key to making most any game as we know them. Perhaps more poignantly, Doom is a 32-bit program and requires a 32-bit CPU (80386 or above), 4 MB of RAM, and the ability to enter protected mode.

Cold-hearted developers like myself will also find some warmth in the fact that Rebane did not use any vibe-coding or AI bot assistance for writing this emulator. And as she points out, a bot could have hardly done this, as the necessary leaps in logic to force CSS to be a full-fledged state machine require some serious out-of-the-box thinking. Rebane points to Jane Ori's CSS CPU Hack as instrumental to her own ideas.

As to the reason or utility of such an enterprise, she simply stated that it was a fun project. Many developers (me included) have long made jokes when people mention HTML and CSS as "programming languages," and this is definitely a moment of harsh acceptance. Some commenters wonder if this implies that contemporary CSS might become a serious attack vector, but that seems unlikely given that Rebane had to create the machine to run the code with.

Google Preferred Source

Follow Tom's Hardware on Google News , or add us as a preferred source , to get our latest news, analysis, & reviews in your feeds.

Advertisement
Advertisement
Mobilize your Website
View Site in Mobile | Classic
Share by: