{"slug": "you-can-t-trust-assembly-an-ai-wrote-here-s-the-3-command-gate", "title": "You can't trust assembly an AI wrote. Here's the 3-command gate.", "summary": "An engineer from TrothByte warns that AI assistants generate assembly code that is confidently wrong in specific, repeatable ways, such as inventing nonexistent mnemonics, flipping operand order, and silently dropping immediates. The proposed fix is a three-command verification gate using GCC and objdump to compare disassembly against the source, catching errors that compile successfully. The project, hosted at github.com/TrothByte/low-level-skills-trothbyte, includes a catalog of 124 verified skills and 177 sources.", "body_md": "✨\n\nDisclosure:this tutorial was drafted with AI assistance. Every technical claim is verified and source-traced in the linked repository.\n\nAI assistants are confident about assembly — and wrong in specific, repeatable ways. They invent mnemonics that do not exist, flip AT&T/Intel operand order, silently drop immediates, and misread bytes. When we audited real incidents, the failures shared a signature: **the code looks plausible and never errors**.\n\nThe fix isn't \"be more careful\". It's a mechanical gate you can run in seconds.\n\n```\n# AT&T / GNU as, x86-64\ngcc -c sample.s && objdump -d sample.o\n\n# Intel syntax\ngcc -c -masm=intel sample.s && objdump -d -M intel sample.o\n```\n\nIf the disassembly does not match what you wrote — same mnemonic, same operands, same size — **you did not write that instruction**. Three real cases this catches:\n\n`movqad`\n\nis not an instruction. The assembler rejects it — so far, so good. The dangerous ones compile.\n\n```\nimul eax, eax, 38      ; assembles to: 69 c0 00 00 00 00\n```\n\nThe `38`\n\nis **silently dropped** by the parser — this is the bug class behind BBoeOS PR#584. The code compiles. The intent is gone.\n\n`-masm=intel`\n\nflips the operand order (`mov eax, [rax]`\n\nvs `mov (%rax), %eax`\n\n). Mixing AT&T and Intel in one file silently changes semantics.\n\nCompiling proves your syntax fits *some* grammar. It does not prove the encoding matches your intent. LLM-based disassembly gets exact instruction matches right about **14%** of the time; \"corrected\" decompilations are right about **37%**. The confidence-to-correctness gap is exactly where the expensive bugs live.\n\nVerify real parallelism (thread counts + wall time, not thread-safe syntax). Verify the API actually exists (`cargo search`\n\n, not memory). Verify your verification — a harness that can't fail is not evidence.\n\nThe full failure catalog and the skills that encode these gates live in\n\n** https://github.com/TrothByte/low-level-skills-trothbyte** —\n\n`researched`\n\nwith exact verification commands.\n\n```\ngit clone https://github.com/TrothByte/low-level-skills-trothbyte\npython tools/validate.py     # 124 skills + registry + 177 sources, gated in seconds\n```\n\nAlso installable via `npx skills add TrothByte/low-level-skills-trothbyte`\n\nor as a Claude Code plugin marketplace.\n\nFound a failure we haven't catalogued? The repo accepts issues — every new skill must be source-traced and differentiated from the existing 124. **Watch the repository to get updates as it grows.**", "url": "https://wpnews.pro/news/you-can-t-trust-assembly-an-ai-wrote-here-s-the-3-command-gate", "canonical_source": "https://dev.to/trothbyte/you-cant-trust-assembly-an-ai-wrote-heres-the-3-command-gate-4ige", "published_at": "2026-08-16 22:29:09+00:00", "updated_at": "2026-08-16 23:12:44.448249+00:00", "lang": "en", "topics": ["developer-tools", "ai-safety"], "entities": ["TrothByte", "BBoeOS", "GCC", "objdump", "Claude Code"], "alternates": {"html": "https://wpnews.pro/news/you-can-t-trust-assembly-an-ai-wrote-here-s-the-3-command-gate", "markdown": "https://wpnews.pro/news/you-can-t-trust-assembly-an-ai-wrote-here-s-the-3-command-gate.md", "text": "https://wpnews.pro/news/you-can-t-trust-assembly-an-ai-wrote-here-s-the-3-command-gate.txt", "jsonld": "https://wpnews.pro/news/you-can-t-trust-assembly-an-ai-wrote-here-s-the-3-command-gate.jsonld"}}