diff options
Diffstat (limited to 'factorial.was')
| -rw-r--r-- | factorial.was | 28 |
1 files changed, 28 insertions, 0 deletions
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 |
