Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 15th, 2012  |  syntax: ASM (NASM)  |  size: 0.36 KB  |  views: 4  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. pushl   %ebp
  2. movl    %esp,%ebp
  3.  
  4. #i've to do ((X/2)*K1)
  5.  
  6. movl    %ebx,-12(%ebp)          #X to stack
  7. movl    $2,-8(%ebp)             #2 to stack
  8. movl    K1,%eax                
  9. movl    %eax,-4(%ebp)           #K1 to stack
  10.  
  11. fildl   -12(%ebp)
  12. fildl   -8(%ebp)
  13. fildl   -4(%ebp)
  14. fdivp   %st(0),%st(1)           #X/2
  15. fmulp   %st(0),%st(1)           #(X/2)*K1
  16.  
  17. fist    -4(%ebp)
  18. movl    -4(%ebp),%eax           #result to eax casted as int
  19. popl    %ebp
  20.  
  21. ret
clone this paste RAW Paste Data