Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. include mpcp.inc
  2.  
  3. .xmm
  4.  
  5. .data
  6.     msg BYTE "Correu: %f",13,10,0
  7.     umPos REAL8 1.0
  8.     umNeg REAL8 -1.0
  9.     num REAL8 0.75
  10.  
  11. .code
  12.  
  13. fx proto x:real8
  14.  
  15. main PROC C
  16.     invoke fx, num
  17.     movsd num, xmm0
  18.     invoke printf, offset msg, real8 ptr [num]
  19.     invoke _getch
  20.     invoke ExitProcess, 0
  21.  
  22. main ENDP
  23.  
  24. fx PROC x:real8
  25.     movsd xmm0, x
  26.     comisd xmm0, umPos
  27.     jae nDom
  28.     comisd xmm0, umNeg
  29.     jbe nDom
  30.     mulsd xmm0, xmm0
  31.     movsd xmm1, umPos
  32.     subsd xmm1, xmm0
  33.     sqrtsd xmm1, xmm1
  34.     movsd xmm0, umPos
  35.     divsd xmm0, xmm1
  36.     jmp Fim
  37. nDom: subsd xmm0, xmm0
  38. Fim: ret
  39.  
  40. fx ENDP
  41.  
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement