forked from abysamross/C_NIX_Programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.s
More file actions
76 lines (76 loc) · 1.3 KB
/
Copy pathglobal.s
File metadata and controls
76 lines (76 loc) · 1.3 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
.file "global.c"
.comm globalX,4,4
.globl globalY_0
.bss
.align 4
.type globalY_0, @object
.size globalY_0, 4
globalY_0:
.zero 4
.globl globalZ_256
.data
.align 4
.type globalZ_256, @object
.size globalZ_256, 4
globalZ_256:
.long 256
.text
.globl func
.type func, @function
func:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -20(%rbp)
movl $0, -12(%rbp)
movl $128, -8(%rbp)
movl globalZ_256(%rip), %eax
subl $1, %eax
movl %eax, globalZ_256(%rip)
subl $1, -8(%rbp)
movl globalX(%rip), %edx
movl globalY_0(%rip), %eax
addl %eax, %edx
movl globalZ_256(%rip), %eax
addl %eax, %edx
movl -20(%rbp), %eax
addl %eax, %edx
movl -4(%rbp), %eax
addl %eax, %edx
movl -12(%rbp), %eax
addl %eax, %edx
movl -8(%rbp), %eax
addl %edx, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size func, .-func
.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 $-1, -4(%rbp)
movl -4(%rbp), %eax
movl %eax, %edi
call func
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size main, .-main
.ident "GCC: (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5"
.section .note.GNU-stack,"",@progbits