-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomprimentoareavolumedocirculo.asm
More file actions
82 lines (65 loc) · 1.1 KB
/
comprimentoareavolumedocirculo.asm
File metadata and controls
82 lines (65 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
%include "io.inc"
extern scanf
extern printf
section .data
fms db "%f",0
fms_out db "%.2f", 0ah,0
valor dd 2
valor2 dd 3
valor3 dd 4
section .bss
raio RESD 1
Comprimento RESQ 1
Area RESQ 1
Volume RESQ 1
section .text
global CMAIN
CMAIN:
mov ebp, esp; for correct debugging
mov esi,raio
push esi
push fms
call scanf
add esp,8
finit
fld DWORD[raio]
Fldpi
fmul
fimul DWORD[valor]
fstp QWORD[Comprimento]
finit
fld DWORD[raio]
fmul st0,st0
fldpi
fmul
fstp QWORD[Area]
finit
fld DWORD[raio]
fmul st0,st0
fld DWORD[raio]
fmul
fild DWORD[valor2]
fmul
fldpi
fmul
fild DWORD[valor3]
fdiv
fstp QWORD[Volume]
push Dword[Comprimento+4]
push Dword[Comprimento]
push fms_out
call printf
add esp,12
push Dword[Area+4]
push Dword[Area]
push fms_out
call printf
add esp,12
push Dword[Volume+4]
push Dword[Volume]
push fms_out
call printf
add esp,12
;write your code here
xor eax, eax
ret