.386
.model flat, stdcall
includelib msvcrt.lib
extern exit: proc
extern printf: proc
extern scanf: proc
public start
.data
mesaj db "n=",0
n dd 0
mesaj2 db "m=",0
m dd 0
format db "%d",0
suma dd 0
mesaj3 db "Suma este:",0
.code
start:
;initializam registrii
xor EAX,EAX
xor EBX,EBX
xor ECX,ECX
xor EDX,EDX
push offset mesaj ;printf("n=");
call printf
add ESP, 4
push offset n ;scanf("%d",&n);
push offset format
call scanf
add ESP, 8
add EBX,n
push offset mesaj2 ;printf("m=");
call printf
add ESP, 4
push offset m ;scanf("%d",&m);
push offset format
call scanf
add ESP, 8
add EBX, m
mov suma, EBX
push offset mesaj3 ;printf("Suma este: %d", n+m);
call printf
add ESP, 4
push offset mesaj
push suma
push offset format
call printf
add ESP, 12
push 0
call exit
end start