summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--phongtorial.mas30
1 files changed, 30 insertions, 0 deletions
diff --git a/phongtorial.mas b/phongtorial.mas
new file mode 100644
index 0000000..9c2c751
--- /dev/null
+++ b/phongtorial.mas
@@ -0,0 +1,30 @@
+/ input and store the phongtorial base
+input
+store base
+store index
+
+begin_calculation, load index
+/ index -= 1
+subt one
+store index
+
+/ base += index
+load base
+add index
+store base
+
+/ if (index != 0) { goto begin_calculation; }
+load index
+skipcond 400
+jump begin_calculation
+
+/ output completed phongtorial
+load base
+output
+
+halt
+
+/ variables
+one, dec 1
+base, hex 0
+index, hex 0