Croissant Runtime
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
crsn/examples/test_cond.csn

36 lines
415 B

(
; test else
(cmp 0 5
(eq? (fault))
(else? (ld r0 15))
(lt? (fault)) ; This should produce a warning
)
(cmp 15 r0
(ne? (fault "else did not run")))
(ld r0 0)
(cmp 0 5
(lt? (nop))
(else? (fault "fallthrough to else"))
)
;
(ld r8 0)
(ld r0 1
(else? (add r8 1))
)
(sub r0 1
(pos? (fault))
(else? (add r8 1))
)
(cmp r8 2
(ne? (fault))
)
)