8086 微码浏览器
8086 Microcode Browser

原始链接: https://nand2mario.github.io/posts/2025/8086_microcode_browser/

一位开发者创建了一个8086微处理器的微码交互式在线浏览器,基于之前提取和反汇编的数据。该工具允许用户以可读格式探索21位微指令,并提供工具提示解释每个字段,以及可点击的跳转目标以便于导航。 该浏览器包含一个“按指令浏览”功能,将超过300条记录在案的8086指令直接链接到其对应的微码例程——令人惊讶的是,只有大约60个独特的例程处理所有指令。 通过研究微码获得的见解揭示了8086设计的迷人细节:寄存器ID具有上下文相关的含义,内部命名不一致,程序计数器(IP)使用“CORR”操作管理预取地址进行调整,并且存在大量的代码重用——尤其是在利用核心“XI”微操作的算术指令中。这个浏览器提供了对这款经典CPU内部运作的深入研究。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 8086 微代码浏览器 (nand2mario.github.io) 10 分,来自 zdw 1 小时前 | 隐藏 | 过去 | 收藏 | 讨论 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Since releasing 486Tang, I’ve been working on recreating the 8086 with a design that stays as faithful as possible to the original chip. That exploration naturally led me deep into the original 8086 microcode — extracted and disassembled by Andrew Jenner in 2020.

Like all microcoded CPUs, the 8086 hides a lot of subtle behavior below the assembly layer. While studying it I kept extensive notes, and those eventually evolved into something more useful: an interactive browser for the entire 8086 microcode ROM.

So here it is: the online 8086 microcode browser. Every 21-bit micro-instruction is decoded into readable fields. Hover over any field and you’ll get a tooltip explaining what it does. All jump targets are clickable — the 8086 μcode uses a surprising number of indirect jumps, calls, and short branches.

One handy feature is Browse by Instruction. Click the button and you’ll get a list of ~300 documented 8086 instructions. Select any one, and the viewer jumps directly to its μcode entry point. Internally there are only about 60 unique μcode entry routines, and this feature makes navigating them effortless.


A few fun tidbits about 8086 μcode

  1. Register IDs change meaning depending on context. For example, 10100 refers to SIGMA (the ALU result) when used as a source, but to tmpaL (the low 8 bits of a temporary ALU register) when used as a destination.

  2. N and R are the same physical register. Meanwhile, SI is called IJ internally — naming inside the chip is extremely inconsistent and reflects its evolutionary design process.

  3. IP (PC) does not point to the next instruction. It actually points to the next prefetch address. The μcode uses a dedicated micro-operation called CORR to rewind IP back to the true next-instruction boundary when handling branches and interrupts.

  4. Almost all arithmetic instructions share the same 4 μinstructions (008–00B). The heavy lifting is done by a single micro-operation named XI, which performs different arithmetic behaviors depending on opcode or ModRM bits. The amount of reuse here is elegant — and very 1978 Intel.

联系我们 contact @ memedata.com