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.
37 lines
532 B
37 lines
532 B
4 years ago
|
(
|
||
4 years ago
|
(mkbf r0)
|
||
4 years ago
|
|
||
4 years ago
|
(bfpush @r0 1)
|
||
|
(bfpush @r0 2)
|
||
4 years ago
|
|
||
4 years ago
|
(bfpop r1 @r0)
|
||
4 years ago
|
(cmp r1 2 (ne? (fault)))
|
||
|
|
||
4 years ago
|
(bfpop r1 @r0)
|
||
4 years ago
|
(cmp r1 1 (ne? (fault)))
|
||
|
|
||
4 years ago
|
; test reverse push
|
||
4 years ago
|
(bfpush @r0 '🐈')
|
||
|
(bfpush @r0 7)
|
||
|
(bfrpush @r0 8)
|
||
4 years ago
|
|
||
4 years ago
|
(bfpop r1 @r0)
|
||
4 years ago
|
(cmp r1 7 (ne? (fault)))
|
||
|
|
||
4 years ago
|
(bfpop r1 @r0)
|
||
4 years ago
|
(cmp r1 '🐈' (ne? (fault)))
|
||
4 years ago
|
|
||
4 years ago
|
(bfpop r1 @r0)
|
||
4 years ago
|
(cmp r1 8 (ne? (fault)))
|
||
|
|
||
|
; test reverse pop
|
||
|
|
||
4 years ago
|
(bfpush @r0 1000)
|
||
|
(bfpush @r0 2000)
|
||
4 years ago
|
|
||
4 years ago
|
(bfrpop r1 @r0)
|
||
4 years ago
|
(cmp r1 1000 (ne? (fault)))
|
||
|
|
||
4 years ago
|
(del @r0)
|
||
4 years ago
|
)
|