1 Star 0 Fork 0

bonsai / 20155313

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.s 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
bonsai 提交于 2017-09-28 18:45 . 0929
.file "main.c"
.section .rodata
.LC0:
.string "enter two numbers:"
.LC1:
.string "%d %d"
.LC2:
.string "add:%d\n"
.LC3:
.string "sub:%d\n"
.LC4:
.string "mul:%d\n"
.LC5:
.string "div:%lf\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movq %fs:40, %rax
movq %rax, -8(%rbp)
xorl %eax, %eax
movl $.LC0, %edi
movl $0, %eax
call printf
leaq -16(%rbp), %rdx
leaq -20(%rbp), %rax
movq %rax, %rsi
movl $.LC1, %edi
movl $0, %eax
call scanf
movl $0, -12(%rbp)
jmp .L2
.L3:
addl $1, -12(%rbp)
.L2:
cmpl $5312, -12(%rbp)
jle .L3
movl -16(%rbp), %edx
movl -20(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call add
movl %eax, %esi
movl $.LC2, %edi
movl $0, %eax
call printf
movl -16(%rbp), %edx
movl -20(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call sub
movl %eax, %esi
movl $.LC3, %edi
movl $0, %eax
call printf
movl -16(%rbp), %edx
movl -20(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call mul
movl %eax, %esi
movl $.LC4, %edi
movl $0, %eax
call printf
movl -16(%rbp), %edx
movl -20(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call div
movl $.LC5, %edi
movl $1, %eax
call printf
movl $0, %eax
movq -8(%rbp), %rcx
xorq %fs:40, %rcx
je .L5
call __stack_chk_fail
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413"
.section .note.GNU-stack,"",@progbits
C
1
https://gitee.com/bonsaiyoung/20155313.git
git@gitee.com:bonsaiyoung/20155313.git
bonsaiyoung
20155313
20155313
master

搜索帮助