386 model flat stdcall includelib kernel32 lib ExitProcess PROTO DWORD

 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
.386
.model flat, stdcall
includelib kernel32.lib
ExitProcess PROTO,:DWORD
includelib user32.lib
MessageBoxA PROTO ,:DWORD, :DWORD, :DWORD, :DWORD
.data
a dd 9
b dd 9
x dd 10
MsgBoxCaption db "Answer", 0
MsgBoxTextY db 'Yes', 0
MsgBoxTextN db 'No', 0
.code
triangle_check PROC
mov ebp, esp
mov eax, [ebp+4]
mov ebx, [ebp+8]
mov ecx, [ebp+12]
cmp eax, ebx
jae a_mark
cmp ebx, ecx
jae b_greatest
jmp c_greatest
a_mark:
cmp eax, ecx
jae a_greatest
c_greatest:
add eax, ebx
cmp eax, ecx
jae yes
jmp no
a_greatest:
add ebx, ecx
cmp ebx, eax
jae yes
jmp no
b_greatest:
add eax, ecx
cmp ebx, eax
jae yes
jmp no
yes:
mov eax, 1
jmp allend
no:
mov eax, 0
allend:
ret 12
triangle_check endp
Winmain PROC
push x
push b
push a
call triangle_check
push 0
push offset MsgBoxCaption
cmp eax, 1
jne neq
push offset MsgBoxTextY
jmp next_param
neq:
push offset MsgBoxTextN
next_param:
push 0
call MessageBoxA
push 0
call ExitProcess
Winmain endp
end Winmain