|
发表于 2019-10-22 21:46:10
|
显示全部楼层
想看计算过程?
喏,看吧
- .file "main.c"
- .text
- .def __main; .scl 2; .type 32; .endef
- .section .rdata,"dr"
- .LC0:
- .ascii "i = %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 $48, %rsp
- .seh_stackalloc 48
- .seh_endprologue
- call __main
- movl $10, -4(%rbp)
- movl -4(%rbp), %eax
- leal -1(%rax), %edx
- movl %edx, -4(%rbp)
- subl $1, -4(%rbp)
- movl $-3, -4(%rbp)
- movl -4(%rbp), %edx
- imull -4(%rbp), %edx
- movl %edx, %r8d
- movl -4(%rbp), %edx
- leal 1(%rdx), %ecx
- movl %ecx, -4(%rbp)
- imull %r8d, %edx
- subl %edx, %eax
- addl $1, -4(%rbp)
- addl %eax, -4(%rbp)
- movl -4(%rbp), %eax
- movl %eax, %edx
- leaq .LC0(%rip), %rcx
- call printf
- movl $0, %eax
- addq $48, %rsp
- popq %rbp
- ret
- .seh_endproc
- .ident "GCC: (GNU) 7.4.0"
- .def printf; .scl 2; .type 32; .endef
复制代码 |
|