summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-04-11 22:51:53 -0700
committerGitHub <[email protected]>2023-04-11 22:51:53 -0700
commit1d9b3d954fd5e6b326817c4198613a16f73f5a94 (patch)
treea17f1c2114b8ca32598af2ea09aae8f3b1398847
parentfaet: modulus of x raised y (diff)
downloadmarie-1d9b3d954fd5e6b326817c4198613a16f73f5a94.tar.xz
marie-1d9b3d954fd5e6b326817c4198613a16f73f5a94.zip
feat: phongtorial
-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