summaryrefslogtreecommitdiff
path: root/phongtorial.mas
blob: 9c2c7513b6785dff6ef4a6dbbb028ec2f30b4b5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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