summaryrefslogtreecommitdiff
path: root/projects/04/misc/iter.asm
blob: c5b11a5deaba96fac5700d630cc7d98a3c89feb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@R1
M=0	// reset R1
@i
M=1	// reset i

(LOOP)
	@i
	D=M
	@R1
	M=M+D	// R1 += i
	@i
	M=M+1	// i++
	@R0
	M=M-1
	D=M
	@END
	D;JEQ
	@LOOP
	0;JMP

(END)
	@END
	0;JMP