From 1d9b3d954fd5e6b326817c4198613a16f73f5a94 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 11 Apr 2023 22:51:53 -0700 Subject: feat: phongtorial --- phongtorial.mas | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 phongtorial.mas 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 -- cgit v1.2.3