docs(asm): add Inline Assembly section to readme

Documents the `asm { … }` expression (template + `-> Type` / `= expr` operands +
clobbers), the §II.5 auto-naming rule (register pin → implicit name; echo form
rejected), the result-shape rule (0→void+volatile / 1→T / N→tuple), `#string`
multi-instruction templates, and top-level global asm + lib-less `extern`
call-into. Per the docs-track-changes rule (inline asm is a landed user-facing
feature). Examples are ones verified running in the corpus.
This commit is contained in:
agra
2026-06-15 22:28:10 +03:00
parent 4d75b9323c
commit b8800a234c
2 changed files with 63 additions and 2 deletions

View File

@@ -159,8 +159,8 @@ via lib-less `extern`). **Remaining feature gap:** `-> @place` write-through /
read-write / indirect-memory outputs (rejected at parse — Phase 2). Smaller
follow-ups: the comptime-call guard for global asm (`#run` into a module-asm
symbol should fail loud via dlsym-miss — pin a test), a JIT-vs-global-asm note
(`sx run` silently mishandles module-asm symbols; AOT is correct), the x86_64
syscall ir-only example, and a `readme.md` inline-asm section (docs-track-changes).
(`sx run` silently mishandles module-asm symbols; AOT is correct), and the x86_64
syscall ir-only example. `readme.md` now has an "Inline Assembly" section.
Known orthogonal bug: **issue 0137**`sx run` on a program with no `main`
segfaults (`src/target.zig:256-273`, unguarded JIT entry lookup). Pre-existing,