add rpush and rpop stack instructions

This commit is contained in:
2020-10-06 12:18:07 +02:00
parent 7ce51c0cc6
commit f4ced467e4
4 changed files with 95 additions and 32 deletions
+22
View File
@@ -10,5 +10,27 @@
(pop r1 @r0)
(cmp r1 1 (ne? (fault)))
; test reverse push
(push @r0 1)
(push @r0 7)
(rpush @r0 8)
(pop r1 @r0)
(cmp r1 7 (ne? (fault)))
(pop r1 @r0)
(cmp r1 1 (ne? (fault)))
(pop r1 @r0)
(cmp r1 8 (ne? (fault)))
; test reverse pop
(push @r0 1000)
(push @r0 2000)
(rpop r1 @r0)
(cmp r1 1000 (ne? (fault)))
(drop @r0)
)