Advertisement
Guest User

Untitled

a guest
May 12th, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %include "io.inc"
  2. extern _printf
  3.  
  4. section .bss
  5.     a resd 1
  6.    
  7. section .data
  8.     b dd -2.0
  9.     c dd 14.0
  10.     fmt db `%f\0`
  11.  
  12. section .text
  13. global _main
  14. _main:
  15.     mov ebp, esp; for correct debugging
  16.     sub esp, 8
  17.     GET_DEC 4, a
  18.     push dword[a]
  19.     call _f2
  20.     mov dword[esp], fmt
  21.     fstp dword[a]
  22.     mov eax, dword[a]
  23.     mov dword[esp + 4], eax
  24.     call _printf
  25.     add esp, 12
  26.     xor eax, eax
  27.     ret
  28. _f2:
  29.     push ebp
  30.     mov ebp, esp
  31.     finit
  32.     fld dword[ebp + 8]
  33.     fmul dword[b]
  34.     fadd dword[c]
  35.     leave
  36.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement