Created
January 12, 2014 11:57
-
-
Save nazarov-yuriy/8383736 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SECTION .data | |
formatin: db "%lld", 0 | |
in1: dq 6 | |
in2: dq 5 | |
formatout: db "%g", 10, 0 | |
var: dq 0.0 | |
SECTION .text | |
global main | |
extern scanf | |
extern printf | |
main: | |
push in1 | |
push formatin | |
call scanf | |
add esp, 8 ; remove parameters | |
push in2 | |
push formatin | |
call scanf | |
add esp, 8 ; remove parameters | |
fild qword [in1] | |
fild qword [in2] | |
fdiv | |
fstp qword [var] | |
push dword [var+4] | |
push dword [var] | |
push formatout | |
call printf | |
add esp, 12 | |
mov eax, 0 | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment