Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .586
- .model flat, C
- includelib msvcrt.lib
- extern exit: proc
- extern printf: proc
- extern scanf: proc
- public start
- .data
- numar_obtinut dq ?
- numar_introdus dd ?
- mesaj_out db "Introduceti o valoare: ", 0
- mesaj_in db "%d", 0
- float_f db "Valoarea obtinuta este: %.3f", 0
- .code
- square proc
- mov EBP, ESP
- FLD1
- FILD DWORD PTR [EBP + 4]
- FIMUL DWORD PTR [EBP + 4] ; <=> val^2
- FDIV ; impartim valorile
- ret
- square endp
- start:
- push offset mesaj_out
- call printf
- add ESP, 04h
- push offset numar_introdus
- push offset mesaj_in
- call scanf
- add ESP, 08h
- push numar_introdus
- call square
- add ESP, 04h
- MOV EBP, ESP ; - ca sa pot afisa double
- FSTP QWORD PTR [EBP]
- push offset float_f
- call printf
- push 0
- call exit
- end start
Advertisement