-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmptwo.asm
71 lines (52 loc) · 2.51 KB
/
cmptwo.asm
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
global main
extern printf
extern scanf
section .data
msg db "Number 1 ", 10 ,0
msg2 db "Number 2 ", 10 ,0
fmt db "%d" , 0
fmtout db "%d" , 10 , 0
inpt1 : times 4 db 0
inpt2 : times 4 db 0
section .text
main:
push ebx
push ecx
push msg
call printf
add esp , 4
push inpt1
push fmt
call scanf
add esp , 8
push msg2
call printf
add esp , 4
push inpt2
push fmt
call scanf
add esp , 8
mov ebx , dword[inpt1]
mov ecx , dword[inpt2]
cmp ebx , ecx
jl print
jg print2
print:
push ecx
push fmtout
call printf
add esp , 8
pop ecx
jmp done
print2:
push ebx
push fmtout
call printf
add esp , 4
pop ebx
jmp done
done:
pop ecx
pop ebx
mov eax , 0
ret