Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- msg db "Selectionner une operation",00h
- msg2 db "1 - Addition",00h
- msg3 db "2 - Soustraction",00h
- msg4 db "Entre un nombre : ",00h
- msg5 db "Ce nombre n'est pas dans le menu",00h
- format db "%d",0
- nl db 0AH,00h
- nbaddi db 1
- segment .bss
- nbmenu resd 1
- nb1 resd 1
- nb2 resd 1
- result resd 1
- segment .text
- global main
- main:
- xor eax,eax
- push msg
- call printf
- add esp,4
- push nl
- call printf
- add esp,4
- push msg2
- call printf
- add esp,4
- push nl
- call printf
- add esp,4
- push msg3
- call printf
- add esp,4
- push nl
- call printf
- add esp,4
- push nbmenu
- push format
- call scanf
- add esp,8
- push nbmenu
- call printf
- add esp,4
- mov eax,[nbmenu]
- cmp eax, '1'
- je addition
- jmp inconnu
- addition:
- push ebp
- mov ebp,esp
- push msg4
- call printf
- add esp,4
- push nl
- call printf
- add esp,4
- push nb1
- push format
- call scanf
- add esp,8
- push msg4
- call printf
- add esp,4
- push nl
- call printf
- add esp,4
- push nb2
- push format
- call scanf
- add esp,8
- mov eax, nb1
- add eax, nb2
- push eax
- call printf
- add esp,4
- mov esp,ebp
- pop ebp
- inconnu:
- push ebp
- mov ebp,esp
- push msg5
- call printf
- add esp,4
- mov esp,ebp
- pop ebp
- push 0
- call exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement