# You can't trust assembly an AI wrote. Here's the 3-command gate.

> Source: <https://dev.to/trothbyte/you-cant-trust-assembly-an-ai-wrote-heres-the-3-command-gate-4ige>
> Published: 2026-08-16 22:29:09+00:00

✨

Disclosure:this tutorial was drafted with AI assistance. Every technical claim is verified and source-traced in the linked repository.

AI 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**.

The fix isn't "be more careful". It's a mechanical gate you can run in seconds.

```
# AT&T / GNU as, x86-64
gcc -c sample.s && objdump -d sample.o

# Intel syntax
gcc -c -masm=intel sample.s && objdump -d -M intel sample.o
```

If 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:

`movqad`

is not an instruction. The assembler rejects it — so far, so good. The dangerous ones compile.

```
imul eax, eax, 38      ; assembles to: 69 c0 00 00 00 00
```

The `38`

is **silently dropped** by the parser — this is the bug class behind BBoeOS PR#584. The code compiles. The intent is gone.

`-masm=intel`

flips the operand order (`mov eax, [rax]`

vs `mov (%rax), %eax`

). Mixing AT&T and Intel in one file silently changes semantics.

Compiling 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.

Verify real parallelism (thread counts + wall time, not thread-safe syntax). Verify the API actually exists (`cargo search`

, not memory). Verify your verification — a harness that can't fail is not evidence.

The full failure catalog and the skills that encode these gates live in

** https://github.com/TrothByte/low-level-skills-trothbyte** —

`researched`

with exact verification commands.

```
git clone https://github.com/TrothByte/low-level-skills-trothbyte
python tools/validate.py     # 124 skills + registry + 177 sources, gated in seconds
```

Also installable via `npx skills add TrothByte/low-level-skills-trothbyte`

or as a Claude Code plugin marketplace.

Found 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.**
