2023-05-12 23:10:52 +00:00
|
|
|
(def ir-asm
|
|
|
|
@{:instructions
|
2023-08-06 20:50:21 +00:00
|
|
|
'((prim 0 s32)
|
2023-08-06 20:50:42 +00:00
|
|
|
(prim 1 f64)
|
|
|
|
(struct 2 0 1)
|
2023-08-07 14:10:15 +00:00
|
|
|
(pointer 3 0)
|
2023-08-08 23:56:02 +00:00
|
|
|
(array 4 1 1024)
|
2023-08-06 20:50:21 +00:00
|
|
|
(bind 0 0)
|
|
|
|
(bind 1 0)
|
|
|
|
(bind 2 0)
|
2023-08-06 20:50:42 +00:00
|
|
|
(bind 3 1)
|
2023-08-08 23:56:02 +00:00
|
|
|
(bind bob 1)
|
2023-08-06 20:50:42 +00:00
|
|
|
(bind 5 1)
|
2023-08-07 01:00:49 +00:00
|
|
|
(bind 6 2)
|
2023-08-06 20:50:42 +00:00
|
|
|
(constant 0 10)
|
|
|
|
(constant 0 21)
|
2023-08-07 14:10:15 +00:00
|
|
|
:location
|
2023-08-06 20:50:21 +00:00
|
|
|
(add 2 1 0)
|
2023-08-06 20:50:42 +00:00
|
|
|
(constant 3 1.77)
|
|
|
|
(call 3 sin 3)
|
2023-08-08 23:56:02 +00:00
|
|
|
(cast bob 2)
|
|
|
|
(add 5 bob 3)
|
2023-08-07 14:10:15 +00:00
|
|
|
(jump :location)
|
2023-08-06 20:50:42 +00:00
|
|
|
(return 5))
|
2023-08-06 20:50:21 +00:00
|
|
|
:parameter-count 0
|
2023-08-07 14:10:15 +00:00
|
|
|
:link-name "test_function"})
|
2023-05-12 23:10:52 +00:00
|
|
|
|
2023-08-06 20:50:21 +00:00
|
|
|
(def as (sysir/asm ir-asm))
|
|
|
|
(print (sysir/to-c as))
|