Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Positif/Negatif
- global main
- extern scanf,printf
- section .data
- fmtin db "%d",0
- pos db "positif",10,0
- nol db "nol",10,0
- nega db "negatif",10,0
- section .bss
- x resd 1
- section .text
- main: ; scanf("%d", &x);
- push x
- push fmtin
- call scanf
- add esp, 8
- ; if (x > 0) printf("positif");
- ; else if (x == 0) printf("nol");
- ; else printf("negatif");
- cmp dword [x], 0
- jg print_pos
- je print_nol
- jl print_neg
- print_pos:
- push pos
- jmp print
- print_nol:
- push nol
- jmp print
- print_neg:
- push nega
- print: call printf
- add esp, 4
- mov eax, 0
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement