SHARE
TWEET

nim_asm.nim

a guest Feb 11th, 2019 95 in 77 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {. passC: "-masm=intel" .}
  2. {.push stackTrace:off.}
  3.  
  4. proc addInt(numa: int): int {.compilerProc, asmNoStackFrame.} =
  5.   # Replace `numa` with a literal integer and it works. is the `` bugged?.
  6.   asm """.intel_syntax noprefix
  7.     mov eax, `numa`
  8.     ret
  9.     """
  10.  
  11. {.pop.}
  12. echo addInt(2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top