TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Design of the LLVM disassembler

13 点作者 alec超过 15 年前

1 comment

barrkel超过 15 年前
Without looking into the code, it's not clear that the article explains the mechanism very well, or even enough to say something interesting. What's a ContextDecision? What's an OpcodeDecision? And ModRMDecision? Are they enums, bitflags, indexes, objects?<p>The most obvious way to write a disassembler (to my mind) specifically for such an idiosyncratic architecture as x86 is a 256-way lookup table mapping the first byte to hand-crafted instruction decoder functions, carefully placed to take advantage of commonalities among certain classes of opcodes. Add some flags into the table and you can extract more commonality. Addressing modes from Mod R/M and SIB can be factored out into separate routines. It adds up to a bunch of grunt work, but ought to be very fast.