From e7f69c8fbbbcbddde84933b2becd91e787d1ac63 Mon Sep 17 00:00:00 2001 From: Johnny Richard Date: Fri, 11 Apr 2025 01:15:01 +0200 Subject: Intial commit Signed-off-by: Johnny Richard --- factorial.was | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 factorial.was (limited to 'factorial.was') diff --git a/factorial.was b/factorial.was new file mode 100644 index 0000000..a8cf222 --- /dev/null +++ b/factorial.was @@ -0,0 +1,28 @@ + push 0 + push 10 + store + push 1 + call 0 + printi + jmp 2 +label0: + push 0 + load + dup + push 0 + swap + push 1 + sub + store + mul + push 0 + load + jz 1 + call 0 +label1: + ret +label2: + printi + push 10 + printc + end -- cgit v1.2.3