tasm.nim 247 B

123456789101112131415
  1. proc testAsm() =
  2. let src = 41
  3. var dst = 0
  4. asm """
  5. mov %1, %0\n\t
  6. add $1, %0
  7. : "=r" (`dst`)
  8. : "r" (`src`)"""
  9. doAssert dst == 42
  10. when defined(gcc) or defined(clang) and not defined(cpp):
  11. {.passc: "-std=c99".}
  12. testAsm()