1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-06 00:36:17 +00:00
janet/examples/sysdialect_asm.janet

18 lines
308 B
Plaintext
Raw Normal View History

2023-05-12 23:10:52 +00:00
(def ir-asm
@{:instructions
'((prim 0 s32)
(bind 0 0)
(bind 1 0)
(bind 2 0)
#(constant 0 10)
(constant 1 20)
(add 2 1 0)
(return 2))
:parameter-count 0
:link-name "main"})
2023-05-12 23:10:52 +00:00
(def as (sysir/asm ir-asm))
(print :did-assemble)
(os/sleep 0.5)
(print (sysir/to-c as))