-
Notifications
You must be signed in to change notification settings - Fork 0
/
number-range.s
82 lines (82 loc) · 1.25 KB
/
number-range.s
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
.file "number-range.c"
.text
.section .rodata
.LC0:
.string "num is bigger than 0"
.text
.globl print
.type print, @function
print:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
leaq .LC0(%rip), %rdi
call puts@PLT
nop
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size print, .-print
.section .rodata
.LC1:
.string "num is bigger than 5"
.LC2:
.string "num is bigger than 10"
.LC3:
.string "num is bigger than 15"
.LC4:
.string "num is bigger than 18"
.text
.globl main
.type main, @function
main:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl $15, -4(%rbp)
cmpl $0, -4(%rbp)
jle .L3
call print
jmp .L4
.L3:
cmpl $5, -4(%rbp)
jle .L5
leaq .LC1(%rip), %rdi
call puts@PLT
jmp .L4
.L5:
cmpl $10, -4(%rbp)
jle .L6
leaq .LC2(%rip), %rdi
call puts@PLT
jmp .L4
.L6:
cmpl $15, -4(%rbp)
jle .L7
leaq .LC3(%rip), %rdi
call puts@PLT
jmp .L4
.L7:
leaq .LC4(%rip), %rdi
call puts@PLT
.L4:
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size main, .-main
.ident "GCC: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0"
.section .note.GNU-stack,"",@progbits