include \masm32\include\masm32rt.inc
.data
.code
start:
exit
tong1_n proc n:DWORD
LOCAL i:DWORD
LOCAL sum:DWORD
mov i, 1
mov sum, 0
batdau:
mov eax, i
cmp eax, n
jle cong
jg thoat
cong:
mov eax, sum
add eax, i
mov sum, eax
add eax, 1
mov i, eax
jmp batdau
thoat:
print chr$("Tong tu 1 den n la: ")
print str$(sum)
ret
tong1_n endp
end start