---------- Forwarded message ----------
From:
Nguyễn Văn, Toàn <toa...@uit.edu.vn>
Date: 2013/6/14
Subject: Code mau 64
To: Phuc Le Sanh <
phuc...@gmail.com>
.file "Hello.c"
.text
.globl Sum
.def Sum; .scl 2; .type 32; .endef
.seh_proc Sum
Sum:
pushq %rbp
.seh_pushreg %rbp
movq %rsp, %rbp
.seh_setframe %rbp, 0
.seh_endprologue
movl %ecx, 16(%rbp)
movl %edx, 24(%rbp)
movl 16(%rbp), %eax
cmpl 24(%rbp), %eax
jle .L2
movl 16(%rbp), %eax
jmp .L3
.L2:
movl 24(%rbp), %eax
.L3:
popq %rbp
ret
.seh_endproc
.def __main; .scl 2; .type 32; .endef
.section .rdata,"dr"
.LC0:
.ascii "%d\0"
.text
.globl main
.def main; .scl 2; .type 32; .endef
.seh_proc main
main:
pushq %rbp
.seh_pushreg %rbp
movq %rsp, %rbp
subq $32, %rsp
.seh_stackalloc 32
.seh_setframe %rbp, 32
.seh_endprologue
call __main
movl $4, %edx
movl $3, %ecx
call Sum
movl %eax, %edx
leaq .LC0(%rip), %rcx
call printf
addq $32, %rsp
popq %rbp
ret
.seh_endproc
.def printf; .scl 2; .type 32; .endef
-
.file "Hello.c"
.text
.globl Sum
.def Sum; .scl 2; .type 32; .endef
.seh_proc Sum
Sum:
pushq %rbp
.seh_pushreg %rbp
movq %rsp, %rbp
subq $16, %rsp
.seh_stackalloc 16
.seh_setframe %rbp, 16
.seh_endprologue
movl %ecx, 16(%rbp)
movl %edx, 24(%rbp)
movl 24(%rbp), %eax
movl 16(%rbp), %edx
addl %edx, %eax
movl %eax, -4(%rbp)
movl -4(%rbp), %eax
addq $16, %rsp
popq %rbp
ret
.seh_endproc
.def __main; .scl 2; .type 32; .endef
.section .rdata,"dr"
.LC0:
.ascii "%d\0"
.text
.globl main
.def main; .scl 2; .type 32; .endef
.seh_proc main
main:
pushq %rbp
.seh_pushreg %rbp
movq %rsp, %rbp
subq $32, %rsp
.seh_stackalloc 32
.seh_setframe %rbp, 32
.seh_endprologue
call __main
movl $4, %edx
movl $3, %ecx
call Sum
movl %eax, %edx
leaq .LC0(%rip), %rcx
call printf
addq $32, %rsp
popq %rbp
ret
.seh_endproc
.def printf; .scl 2; .type 32; .endef
--
Nguyễn Văn Toàn
Phòng Công tác Sinh viên - Trường Đại học Công nghệ thông tin - ĐHQG-HCM
SĐT: 0903761559 - Email: toa...@uit.edu.vn