I'm incredibly pleased to announce that the microcode for the Intel 80386 has been decoded.
-
I'm incredibly pleased to announce that the microcode for the Intel 80386 has been decoded.
It was an group effort by a bunch of talented people to extract and correct the physical bits, but the major work of decoding them was done by reenigne - you may know him from such incredible PC demos as 8088 MPH and Area 5150, as well as being the person who decoded the 8088 microcode previously.
Please, check out his writeup.
#retrocomputing #vintagecomputing #microcode #reverseengineering
-
I'm incredibly pleased to announce that the microcode for the Intel 80386 has been decoded.
It was an group effort by a bunch of talented people to extract and correct the physical bits, but the major work of decoding them was done by reenigne - you may know him from such incredible PC demos as 8088 MPH and Area 5150, as well as being the person who decoded the 8088 microcode previously.
Please, check out his writeup.
#retrocomputing #vintagecomputing #microcode #reverseengineering
-
It doesn't stop there. The incredibly talented nand2mario has taken reenigne's work and created a microcode-level Verilog implementation of the 80386. And yes, it runs DOOM. There's even a MiSTer core in the works.
https://nand2mario.github.io/posts/2026/z386/
https://github.com/nand2mario/z386
https://github.com/nand2mario/z386_MiSTer -
It doesn't stop there. The incredibly talented nand2mario has taken reenigne's work and created a microcode-level Verilog implementation of the 80386. And yes, it runs DOOM. There's even a MiSTer core in the works.
https://nand2mario.github.io/posts/2026/z386/
https://github.com/nand2mario/z386
https://github.com/nand2mario/z386_MiSTerYou can find all the files, notes, decoded PLAs and such here. Everything is released to the public in the name of increasing our knowledge, improving emulation, and preserving our collective computing past.
-
You can find all the files, notes, decoded PLAs and such here. Everything is released to the public in the name of increasing our knowledge, improving emulation, and preserving our collective computing past.
This was only possible in the first place thanks to excellent die photography by @kenshirriff
Here's a corner of the 80386 microcode as seen under the microscope.

-
This was only possible in the first place thanks to excellent die photography by @kenshirriff
Here's a corner of the 80386 microcode as seen under the microscope.

Bits are encoded by the presence of these gates.

-
I'm incredibly pleased to announce that the microcode for the Intel 80386 has been decoded.
It was an group effort by a bunch of talented people to extract and correct the physical bits, but the major work of decoding them was done by reenigne - you may know him from such incredible PC demos as 8088 MPH and Area 5150, as well as being the person who decoded the 8088 microcode previously.
Please, check out his writeup.
#retrocomputing #vintagecomputing #microcode #reverseengineering
@gloriouscow Fantastic work!
-
Bits are encoded by the presence of these gates.

It's fairly easy to visually decode them. But now just do that 94,000 times.
-
It's fairly easy to visually decode them. But now just do that 94,000 times.
Complicating matters was that some of the areas of the photo-mosaic were out of focus.
This made automated extraction tools fail miserably.

-
Complicating matters was that some of the areas of the photo-mosaic were out of focus.
This made automated extraction tools fail miserably.

There was previously a reference to AI, but don't panic. No rainforests were burned down. What we used were old-fashioned, brainless convolutional neural networks trained on consumer video cards - an idea Smartest Blob came up with and that I re-used for my extraction of the NEC V20 microcode.
-
There was previously a reference to AI, but don't panic. No rainforests were burned down. What we used were old-fashioned, brainless convolutional neural networks trained on consumer video cards - an idea Smartest Blob came up with and that I re-used for my extraction of the NEC V20 microcode.
The results were then just laboriously hand-checked by eye over weeks.
electroly, specifically - thank you for your help.
-
The results were then just laboriously hand-checked by eye over weeks.
electroly, specifically - thank you for your help.
One of my early experiments in OpenCV produced an unintentional piece of Microcode Art I'm still fond of.
This was a result of attempting auto-segmentation using incrementing hue on the various segments. Needless to say, a lovely disaster.
-
There was previously a reference to AI, but don't panic. No rainforests were burned down. What we used were old-fashioned, brainless convolutional neural networks trained on consumer video cards - an idea Smartest Blob came up with and that I re-used for my extraction of the NEC V20 microcode.
@gloriouscow I really wish we could get folks using terms like neutral net and regression analysis again to contrast against generative/LLM offal. There are legitimate and powerful tools in this field, but they've been pumped in together with asbestos...
-
@gloriouscow I really wish we could get folks using terms like neutral net and regression analysis again to contrast against generative/LLM offal. There are legitimate and powerful tools in this field, but they've been pumped in together with asbestos...
@wcbdata i've already suggested he swap out 'AI' for 'neural networks', should see that change here in a bit.
-
There was previously a reference to AI, but don't panic. No rainforests were burned down. What we used were old-fashioned, brainless convolutional neural networks trained on consumer video cards - an idea Smartest Blob came up with and that I re-used for my extraction of the NEC V20 microcode.
@gloriouscow oh is microcode self-similar enough and also abundant enough to be useful for this? (Or is like one guy writing all the microcode for everything?) fascinating
-
@wcbdata i've already suggested he swap out 'AI' for 'neural networks', should see that change here in a bit.
@gloriouscow Love it! I miss that stuff - I worked with some brilliant statisticians and mathematicians back in the day...
-
@gloriouscow oh is microcode self-similar enough and also abundant enough to be useful for this? (Or is like one guy writing all the microcode for everything?) fascinating
@thomasfuchs The technique for extracting bits (is this a bit or not a bit) is the same, and the same technique of training a CNN to classify "bit" or "not bit" is essentially Hot Dog / Not Hot Dog, something CNNs are very good at, even when things are blurry (in fact, intentionally blurring your training data makes the CNN better)
-
@thomasfuchs The technique for extracting bits (is this a bit or not a bit) is the same, and the same technique of training a CNN to classify "bit" or "not bit" is essentially Hot Dog / Not Hot Dog, something CNNs are very good at, even when things are blurry (in fact, intentionally blurring your training data makes the CNN better)
@thomasfuchs Once you have the bits in a two-dimensional bitmap, you have to extract them into words, figure out the fields within each word, a process that on the 80386 was probably actually harder than getting the bits out in the first place.
We used a lot of Python scripts to permute the bits in different ways and see if various patterns emerged that would delineate field lines.
For the 8088 and V20 we were very fortunate as the lawsuits between intel and NEC ended up with the publication in the public record of the microcode word layout for both chips. No such luck with the 386!
-
@thomasfuchs Once you have the bits in a two-dimensional bitmap, you have to extract them into words, figure out the fields within each word, a process that on the 80386 was probably actually harder than getting the bits out in the first place.
We used a lot of Python scripts to permute the bits in different ways and see if various patterns emerged that would delineate field lines.
For the 8088 and V20 we were very fortunate as the lawsuits between intel and NEC ended up with the publication in the public record of the microcode word layout for both chips. No such luck with the 386!
@thomasfuchs The same CNN process was used to extract the multi-level microcode for the 8087 - the process of decoding that is still on-going.
That chip is insane and @kenshirriff is about our only hope for ever decoding how it works. It has microcode, but there is far less separation between discrete logic and the microcode engine than on conventional CPUs. It's like the roots have grown into all the plumbing, and requites laborious circuit-tracing to understand what the much of the microcode even does.
You can see the extracted 8087 microcode here. No mistakes were ever found or reported:
oh, i actually see someone's opened two issues. i must have missed the email lol
-
S stefano@mastodon.bsd.cafe shared this topic
-
One of my early experiments in OpenCV produced an unintentional piece of Microcode Art I'm still fond of.
This was a result of attempting auto-segmentation using incrementing hue on the various segments. Needless to say, a lovely disaster.
Just an addendum - we'd love to do the same for the 80286, to complete the early Intel trifecta.
The main reason that the 386 was done first is that Intel used an implant ROM on the 286 for some reason we can't fathom.
An implant ROM uses invisible doping to create the microcode bit gates. You can take pictures of it under a microscope all you want, you can't read shit.
