2017-12-08 20:57:02 +00:00
|
|
|
# A fairly minimal example of a dst assembly file
|
2017-11-25 04:17:04 +00:00
|
|
|
{
|
|
|
|
bytecode [
|
2017-11-27 00:31:40 +00:00
|
|
|
(load-integer 0 15)
|
2017-11-25 04:17:04 +00:00
|
|
|
(load-integer 1 0)
|
|
|
|
(load-constant 3 lookup)
|
|
|
|
|
|
|
|
:label
|
|
|
|
(equals 2 1 0)
|
|
|
|
(jump-if 2 :done)
|
2017-11-27 00:31:40 +00:00
|
|
|
(add-immediate 0 0 -1)
|
2017-11-25 04:17:04 +00:00
|
|
|
(get 2 3 0)
|
2017-11-27 00:31:40 +00:00
|
|
|
(push 2)
|
2017-11-25 04:17:04 +00:00
|
|
|
(syscall 2 0)
|
|
|
|
(jump :label)
|
|
|
|
|
|
|
|
:done
|
|
|
|
(return-nil)
|
2017-12-08 20:57:02 +00:00
|
|
|
|
|
|
|
:extra
|
|
|
|
(push 2r1010101010101010)
|
2017-11-25 04:17:04 +00:00
|
|
|
]
|
|
|
|
constants [
|
|
|
|
(def lookup "0123456789abcdef")
|
|
|
|
]
|
|
|
|
}
|