# asmdiff

Single-file, stdlib-only Python CLI that compares per-function assembly
between paired C implementations across a compiler matrix. Published to
PyPI as `asmdiff` (hatchling build, see pyproject.toml).

## Toolchain

- Runtime: Python >= 3.8; config files (asmdiff.toml) need >= 3.11 (tomllib).
- No third-party dependencies, in source or tests. Keep it that way.
- Compilers invoked at runtime: whatever the user's matrix names
  (host gcc/clang, xtensa/riscv ESP toolchains via glob patterns).

## Commands

- Run tests: `python3 test_asmdiff.py` (unittest; add `-v` for detail).
- Run the tool: `python3 asmdiff.py asmdiff_example.c`.
- Everything is safe/reversible: the tool only compiles to `-S` in a
  temp dir and prints. No flashing, no shared infra.

## Layout

- `asmdiff.py` — the entire tool.
- `test_asmdiff.py` — unit tests, one class per feature area.
- `asmdiff.example.toml` — documented starter config; keep it generic:
  portable gcc/clang defaults plus active embedded target profiles
  grouped by toolchain family (riscv32-esp, xtensa-esp, and basic
  stm32/rp2350 entries), default install paths or bare PATH names and
  minimal arch flags only, nothing machine-specific. Mirrored
  byte-for-byte in asmdiff.py's EXAMPLE_CONFIG (a unit test enforces
  the match): any edit to the toml must update the constant too.
- README.md documents every user-visible behavior; changes to flags or
  config keys update README, example toml, and the module docstring.
