peon125

Untitled

Jan 10th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .text use32
  2.  
  3. global  _wyrazenie
  4.  
  5. _wyrazenie:
  6.  
  7.     %idefine    a   [ebp+8]
  8.     %idefine    b   [ebp+12]
  9.  
  10.     ;gcc a.o a.c -o a.exe
  11.     push    ebp
  12.     mov ebp, esp
  13.  
  14.     finit
  15.     fld dword [jeden]
  16.     fld dword [jeden]
  17.     fld dword a
  18.    
  19.     call procedura_petla
  20.     fstp dword [pierwsza]
  21.    
  22.     ffree st0
  23.     ffree st0
  24.    
  25.     fld dword b
  26.     fld dword a
  27.     fsub st1
  28.     fstp dword [druga_temp]
  29.     ffree st0
  30.    
  31.     fld dword [jeden]
  32.     fld dword [jeden]
  33.     fld dword [druga_temp]  
  34.    
  35.     call procedura_petla
  36.     fstp dword [druga]
  37.    
  38.     fld dword [druga]
  39.     fld dword [pierwsza]
  40.     fdiv st0, st1
  41.    
  42.     koniec:
  43.     leave
  44.     ret
  45.    
  46.     procedura_petla:
  47.     petla:
  48.     fxch st1
  49.     fmul st0, st1
  50.     fxch st1
  51.     fsub st2
  52.     fcom st2
  53.     fstsw   ax
  54.     sahf
  55.     jne petla
  56.     fxch st1
  57.     ret
  58.    
  59. section .data
  60.     jeden dd 1.0
  61.     pierwsza dd 21.36
  62.     druga dd 21.37
  63.     druga_temp db 21.38
Add Comment
Please, Sign In to add comment