Hacker News new | ask | show | jobs
by jart 1930 days ago
If you need an authoritative assembler / disassembler for x86 then check out https://intelxed.github.io/ There's a bunch of instructions that don't round-trip with the gnu assembler.

    # lea (%esi,%eiz,8),%esi # Error: bad register name `%eiz'
    .byte 0x67,0x8d,0x34,0xe6
That's an example of one such instruction. It uses an overlong encoding. If you ask Xed to encode it then you get:

    .byte 0x67,0x8D,0x36
    lea (%esi),%esi
Not sure I'd call that an anomaly. I'd reserve that term for what the hardware might do if you pass it undefined opcodes.