-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4args.S
57 lines (57 loc) · 1.07 KB
/
4args.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
.file "4args.c"
.def __main; .scl 2; .type 32; .endef
.section .rdata,"dr"
.LC0:
.ascii "%d+%d+%d+%d=%d\12\0"
.text
.globl main
.def main; .scl 2; .type 32; .endef
.seh_proc main
main:
pushq %rbp
.seh_pushreg %rbp
movq %rsp, %rbp
.seh_setframe %rbp, 0
subq $80, %rsp
.seh_stackalloc 80
.seh_endprologue
call __main
movl $1, -4(%rbp)
movl -4(%rbp), %eax
addl $1, %eax
movl %eax, -8(%rbp)
movl -8(%rbp), %eax
addl $1, %eax
movl %eax, -12(%rbp)
movl -12(%rbp), %eax
addl $1, %eax
movl %eax, -16(%rbp)
movl -16(%rbp), %r8d
movl -12(%rbp), %ecx
movl -8(%rbp), %edx
movl -4(%rbp), %eax
movl %r8d, %r9d
movl %ecx, %r8d
movl %eax, %ecx
call L3
movl %eax, -20(%rbp)
movl -12(%rbp), %r8d
movl -8(%rbp), %ecx
movl -4(%rbp), %eax
movl -20(%rbp), %edx
movl %edx, 40(%rsp)
movl -16(%rbp), %edx
movl %edx, 32(%rsp)
movl %r8d, %r9d
movl %ecx, %r8d
movl %eax, %edx
leaq .LC0(%rip), %rcx
call printf
movl $0, %eax
addq $80, %rsp
popq %rbp
ret
.seh_endproc
.ident "GCC: (tdm64-1) 5.1.0"
.def L3; .scl 2; .type 32; .endef
.def printf; .scl 2; .type 32; .endef