-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuesta01prova03Wagner.asm
More file actions
90 lines (70 loc) · 1.21 KB
/
Questa01prova03Wagner.asm
File metadata and controls
90 lines (70 loc) · 1.21 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
83
84
85
86
87
88
89
90
; Calcular o IMC precisar do PESO EM KILOS e DA AlTURA EM METROS
extern scanf
extern printf
section .data
fms db "%f", 0ah,0
string1 db "Acima do Peso",0
string2 db "Peso Normal",0
string3 db "Abaixo do Peso",0
acima dd 30
abaixo dd 18
divi dd 2
section .bss
peso RESD 1
altura RESD 1
resultado RESQ 1
section .text
global main
main:
mov ebp, esp; for correct debugging
mov ebp, esp; for correct debugging
pulo:
push peso
push fms
call scanf
add esp,8
push altura
push fms
call scanf
add esp,8
finit
fld DWORD[altura]
fmul st0,st0
fld DWORD[peso]
fdiv st0,st1
fstp QWORD[resultado]
finit
fild DWORD[acima]
fld QWORD[resultado]
fcomi st0,st1
JAE acimadopeso
finit
FLD1
FiDIV DWORD[divi]
fild DWORD[abaixo]
FADD
fld QWORD[resultado]
fcomi st0,st1
JAE pesonormal
jmp abaixodopeso
acimadopeso:
push string1
call printf
add esp,4
mov esp,ebp
xor eax, eax
ret
pesonormal:
push string2
call printf
add esp,4
mov esp,ebp
xor eax, eax
ret
abaixodopeso:
push string3
call printf
add esp,4
mov esp,ebp
xor eax, eax
ret