@i
M=1
@sum
M=0
(LOOP)
D=M
@10
D=D-A
@END // refers to the instruction memory location for END label and puts that in A
D;JGT
M=D+M
M=M+1
@LOOP // Put the instruction memory location for LOOP in A
0;JMP // Jump to A
(END)
@R0
M=D
@END
0;JMP