Skip to content

Instantly share code, notes, and snippets.

@nazarov-yuriy
Created January 12, 2014 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazarov-yuriy/8383736 to your computer and use it in GitHub Desktop.
Save nazarov-yuriy/8383736 to your computer and use it in GitHub Desktop.
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