Professional Documents
Culture Documents
accepted then sum of them is printed out. Value of n is received from user.
include\masm32\include\masm32rt.inc
.code
start:
call main
exit
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
main proc
LOCAL a : DWORD
LOCAL b : DWORD
LOCAL sum : DWORD
LOCAL n : DWORD
LOCAL i : DWORD
CALC:
print chr$("Lap lan thu: ")
print str$(i)
print chr$(13, 10)
mov eax, 0
mov a, sval(input("Nhap so thu nhat: "))
mov b, sval(input("Nhap so thu hai: "))
mov eax, a
add eax, b
mov sum, eax
print chr$("Sum of 2 number: ")
print str$(sum)
print chr$(13, 10)
inc i
jmp VONGLAP
EXIT:
ret
main endp
end start