TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Design of the LLVM disassembler

13 pointsby alecover 15 years ago

1 comment

barrkelover 15 years ago
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.