Skip to content

Instantly share code, notes, and snippets.

@mratsim
Created November 2, 2019 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mratsim/b8ba75c00b78028feba42628f339dbd5 to your computer and use it in GitHub Desktop.
Save mratsim/b8ba75c00b78028feba42628f339dbd5 to your computer and use it in GitHub Desktop.
Nim to Assembly

Either

nim c --passC:"-fno-asynchronous-unwind-tables -fno-exceptions -fno-rtti -fverbose-asm -masm=intel -S" -d:release --noLinking:on "path/to/file.nim"

The result will be in $HOME/.cache/file_r/file.c.o (_r for release) The C sources or Nim sources (with --debugger:native) will be interleaved with ASM

Otherwise use:

nim c --passC:"-fno-asynchronous-unwind-tables -fno-exceptions -fno-rtti -masm=intel -S" -d:release --noLinking:on "path/to/file.nim"

i.e. remove -fverbose-asm, for pure ASM output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment