x86CSS
x86 CPU made in CSS
by Lyra Rebane Hold a button to input it:
0123456789 QWERTYUIOP ASDFGHJKL ZXCVBNM
INST | AX | CX | DX | BX | SP | BP | SI | DI | IP | ES | CS | SS | DS
About
x86CSS is a working CSS-only x86 CPU/emulator/computer. Yes, the Cascading Style Sheets CSS. No JavaScript required.
What you're seeing above is a C program that was compiled using GCC into native 8086 machine code being executed fully within CSS.
GitHub ⧸ Fedi, Bluesky, Twitter
Frequently Asked Questions
Is CSS a programming language?
Do you really need to ask at this point?
How??
I plan on writing a blog post that explains how this works as well as many of the tricks used. Bookmark my blog or add it to your RSS reader.
Surely you still need a little bit of JavaScript?
Nope, this is CSS-only!
There is a script tag on this site, which is there to provide a clock to the CSS - but this is only there to make the entire thing a bit faster and more stable. The CSS also has a JS-less clock implementation, so if you disable scripts on this site, it will still run. JavaScript is not required.
My CSS clock uses an animation combined with style container queries, which means you don't need to interact with anything for the program to run, but it also means its a bit slower and less stable as a result. A hover-based clock, such as the one in Jane Ori's CPU Hack, is fast and stable, but requires you to hold your mouse on the screen, which some people claim does not count as turing complete for whatever reason, so I wanted this demo to be fully functional with zero user input.
But you still need HTML, right?
Not really... well, kind of?
This entire CPU runs in just CSS and doesn't require any HTML code, but there is no way to load the CSS without a