mirror of
https://github.com/janet-lang/janet
synced 2024-07-12 23:04:29 +00:00
18 lines
308 B
Plaintext
18 lines
308 B
Plaintext
(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"})
|
|
|
|
(def as (sysir/asm ir-asm))
|
|
(print :did-assemble)
|
|
(os/sleep 0.5)
|
|
(print (sysir/to-c as))
|