Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • It would be really nice to have something like this for the x86-64 variant.
  • https://www.sandpile.org/

    concise & complete

    1996 - 2025

    with APX

  • Here is some explanation from the source plus some code that can encode/decode x86 instructions in software
  • I was recently working on some x86 emulation code. This is one of the best links that I found to summarize how it works, skipping the giant Intel instruction set references.
  • This uses frames and the link is to the inner frame, maybe is should rather link to https://www-user.tu-chemnitz.de/~heha/hs/chm/x86.chm/ . Nevertheless, this is a nice looking website.
  • This is so relevant for me!

    I spent some time last weekend on a small side project which involves JIT encoding ARM64 instructions to run them on Apple Silicon.

    I’ve written assembly before, but encoding was always kind of black magic.

    How surprised was I to learn how simple instruction encoding is on arm64! Arguably simpler than implementing encoding wasm to byte code, which I played with a while ago.

    If you want to play with this, based on my very very limited experience so far, I’d suggest starting with arm - fixed length 4 byte instructions, nice register naming scheme, straightforward encoding of arguments, make it very friendly.

  • This reminds me that at some point I should write up my exploration of the x86 encoding scheme, because a lot of the traditional explanations tend to be overly focused on how the 8086 would have decoded instructions, which isn't exactly the same way you look at them for a modern processors.

    I actually have a tool I wrote to automatically derive on x86 decoder from observing hardware execution (based in part on sandsifter, so please don't ask me if I've heard of it), and it turns out to largely be a lot simpler than people make it out to be... if you take a step back and ignore some of what people have said about the role of various instruction prefixes (they're not prefixes, they're extra opcode bits).

    (FWIW, this is fairly dated in that it doesn't cover the three-byte opcodes, or the 64-bit prefixes that were added, like the REX and VEX prefixes).

Explore Birbla archives