mirror of
https://github.com/janet-lang/janet
synced 2024-11-18 14:44:48 +00:00
01a95426b3
segfaults alot. Added dst_disasm to reconstruct dsts assembly from a funcdef.
27 lines
404 B
Plaintext
27 lines
404 B
Plaintext
# A fairly minimal example of a dst assembly file
|
|
{
|
|
bytecode [
|
|
(load-integer 0 15)
|
|
(load-integer 1 0)
|
|
(load-constant 3 lookup)
|
|
|
|
:label
|
|
(equals 2 1 0)
|
|
(jump-if 2 :done)
|
|
(add-immediate 0 0 -1)
|
|
(get 2 3 0)
|
|
(push 2)
|
|
(syscall 2 0)
|
|
(jump :label)
|
|
|
|
:done
|
|
(return-nil)
|
|
|
|
:extra
|
|
(push 2)
|
|
]
|
|
constants [
|
|
(def lookup "0123456789abcdef")
|
|
]
|
|
}
|