Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SECTION .data
- messaggio db "Inserire un numero intero",10,0
- fmt db "%s",0
- fmtd db "%d %d",0
- fmtmol db "Moltiplicazione = %d",10,0
- fmtdiv db "Divisione intera = %d resto: %d",10,0
- a dd 0
- b dd 0
- ris dd 0
- resto dd 0
- SECTION .txt
- global main
- extern printf
- extend scanf
- main: push ebp //memorizzano lo stato dello stack
- mov ebp,esp
- push messaggio
- push fmt
- call scanf
- push a
- push b
- push fmtd
- call scanf
- mov eax,[a]
- mov ebx,[b]
- mul ebx
- mov [ris],eax
- push dword[ris]
- push fmtmol
- call printf
- mov eax,[a]
- mov ebx,[b]
- mov edx,0
- div ebx
- mov [ris],eax
- mov [resto],edx
- push dword[resto]
- push dword[ris]
- push fmtdiv
- call printf
- mov esp,ebp
- pop ebp
- ret
- mov esp,ebp
- pop ebp
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement