From 8d585d765bb8ab96bc042911a6616429c87aa4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Thu, 1 Oct 2020 23:36:33 +0200 Subject: [PATCH] stacks example --- examples/stacks.csn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/stacks.csn diff --git a/examples/stacks.csn b/examples/stacks.csn new file mode 100644 index 0000000..c2f5111 --- /dev/null +++ b/examples/stacks.csn @@ -0,0 +1,15 @@ +( + (stack r0) + + (push @r0 1) + (push @r0 2) + + (pop r1 @r0) + (cmp r1 2 (ne? (fault))) + + (pop r1 @r0) + (cmp r1 1 (ne? (fault))) + + (drop @r0) + (halt) +)