1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-10 21:37:43 +00:00

Add ffi jit example.

This commit is contained in:
Calvin Rose
2022-12-03 17:52:23 -06:00
parent c731f01067
commit aa60c1f36a
4 changed files with 46 additions and 8 deletions

17
examples/jitfn/hello.nasm Normal file
View File

@@ -0,0 +1,17 @@
BITS 64
;;;
;;; Code
;;;
mov rax, 1 ; write(
mov rdi, 1 ; STDOUT_FILENO,
lea rsi, [rel msg] ; msg,
mov rdx, msglen ; sizeof(msg)
syscall ; );
ret ; return;
;;;
;;; Constants
;;;
msg: db "Hello, world!", 10
msglen: equ $ - msg