include \masm32\include\masm32rt.inc .data x dd ? tong1_n PROTO :DWORD .code start: mov x, sval(input("Nhap n = ")) invoke tong1_n, x 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 inc i ;mov eax, i ;add eax, 1 ;mov i, eax jmp batdau thoat: print chr$("Tong tu 1 den n la: ") print str$(sum) print chr$(13, 10) ret tong1_n endp end start