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_bfio.csn

53 lines
1.4 KiB

(
(mkbf r0)
; Default mode - queue
(ld @r0 1)
(ld @r0 2)
(ld @r0 3)
(bfrd r1 @r0 2) (cmp r1 3 (ne? (fault))) ; last is 3
(ld r1 @r0) (cmp r1 1 (ne? (fault)))
(ld r1 @r0) (cmp r1 2 (ne? (fault)))
(ld r1 @r0) (cmp r1 3 (ne? (fault)))
(bfio @r0 BFIO_QUEUE)
(ld @r0 1)
(ld @r0 2)
(ld @r0 3)
(bfrd r1 @r0 2) (cmp r1 3 (ne? (fault))) ; last is 3
(ld r1 @r0) (cmp r1 1 (ne? (fault)))
(ld r1 @r0) (cmp r1 2 (ne? (fault)))
(ld r1 @r0) (cmp r1 3 (ne? (fault)))
(bfio @r0 BFIO_RQUEUE)
(ld @r0 1)
(ld @r0 2)
(ld @r0 3)
(bfrd r1 @r0 0) (cmp r1 3 (ne? (fault)))
(bfrd r1 @r0 2) (cmp r1 1 (ne? (fault))) ; last is 1
(ld r1 @r0) (cmp r1 1 (ne? (fault)))
(ld r1 @r0) (cmp r1 2 (ne? (fault)))
(ld r1 @r0) (cmp r1 3 (ne? (fault)))
(bfio @r0 BFIO_STACK)
(ld @r0 1)
(ld @r0 2)
(ld @r0 3)
(bfrd r1 @r0 0) (cmp r1 1 (ne? (fault)))
(bfrd r1 @r0 2) (cmp r1 3 (ne? (fault)))
(ld r1 @r0) (cmp r1 3 (ne? (fault)))
(ld r1 @r0) (cmp r1 2 (ne? (fault)))
(ld r1 @r0) (cmp r1 1 (ne? (fault)))
(bfio @r0 BFIO_RSTACK)
(ld @r0 1)
(ld @r0 2)
(ld @r0 3)
(bfrd r1 @r0 0) (cmp r1 3 (ne? (fault)))
(bfrd r1 @r0 2) (cmp r1 1 (ne? (fault)))
(ld r1 @r0) (cmp r1 3 (ne? (fault)))
(ld r1 @r0) (cmp r1 2 (ne? (fault)))
(ld r1 @r0) (cmp r1 1 (ne? (fault)))
(del @r0)
)