|
发表于 2021-10-28 12:47:11
|
显示全部楼层
这是上面那个代码的汇编语言版本,但是你现在还看不懂对吧?
你的这个问题的答案全在下面这个汇编语言代码中
等你什么时候看得懂了这个代码,你的这个问题才算得上是真的得到了解决
很抱歉,我没办法给你解释清楚这一切,因为你现在还有好多东西没有学,你至少也需要先把汇编语言学完
- .file "main.cpp"
- .text
- .section .rdata,"dr"
- _ZStL19piecewise_construct:
- .space 1
- .lcomm _ZStL8__ioinit,1,1
- .section .text$_ZN7point_tC1Ell,"x"
- .linkonce discard
- .align 2
- .globl _ZN7point_tC1Ell
- .def _ZN7point_tC1Ell; .scl 2; .type 32; .endef
- .seh_proc _ZN7point_tC1Ell
- _ZN7point_tC1Ell:
- .LFB1496:
- pushq %rbp
- .seh_pushreg %rbp
- movq %rsp, %rbp
- .seh_setframe %rbp, 0
- .seh_endprologue
- movq %rcx, 16(%rbp)
- movq %rdx, 24(%rbp)
- movq %r8, 32(%rbp)
- movq 16(%rbp), %rax
- movq 24(%rbp), %rdx
- movq %rdx, (%rax)
- movq 16(%rbp), %rax
- movq 32(%rbp), %rdx
- movq %rdx, 8(%rax)
- nop
- popq %rbp
- ret
- .seh_endproc
- .section .rdata,"dr"
- .LC0:
- .ascii "this: \0"
- .LC1:
- .ascii "(\0"
- .LC2:
- .ascii ", \0"
- .LC3:
- .ascii ")\0"
- .section .text$_ZN7point_t5printEv,"x"
- .linkonce discard
- .align 2
- .globl _ZN7point_t5printEv
- .def _ZN7point_t5printEv; .scl 2; .type 32; .endef
- .seh_proc _ZN7point_t5printEv
- _ZN7point_t5printEv:
- .LFB1497:
- pushq %rbp
- .seh_pushreg %rbp
- movq %rsp, %rbp
- .seh_setframe %rbp, 0
- subq $32, %rsp
- .seh_stackalloc 32
- .seh_endprologue
- movq %rcx, 16(%rbp)
- leaq .LC0(%rip), %rdx
- movq .refptr._ZSt4cout(%rip), %rcx
- call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
- movq 16(%rbp), %rdx
- movq %rax, %rcx
- call _ZNSolsEPKv
- movq .refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(%rip), %rdx
- movq %rax, %rcx
- call _ZNSolsEPFRSoS_E
- leaq .LC1(%rip), %rdx
- movq .refptr._ZSt4cout(%rip), %rcx
- call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
- movq %rax, %rcx
- movq 16(%rbp), %rax
- movq (%rax), %rax
- movq %rax, %rdx
- call _ZNSolsEl
- leaq .LC2(%rip), %rdx
- movq %rax, %rcx
- call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
- movq %rax, %rcx
- movq 16(%rbp), %rax
- movq 8(%rax), %rax
- movq %rax, %rdx
- call _ZNSolsEl
- leaq .LC3(%rip), %rdx
- movq %rax, %rcx
- call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
- movq .refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(%rip), %rdx
- movq %rax, %rcx
- call _ZNSolsEPFRSoS_E
- nop
- addq $32, %rsp
- popq %rbp
- ret
- .seh_endproc
- .def __main; .scl 2; .type 32; .endef
- .section .rdata,"dr"
- .LC4:
- .ascii "&p1: \0"
- .LC5:
- .ascii "&p2: \0"
- .text
- .globl main
- .def main; .scl 2; .type 32; .endef
- .seh_proc main
- main:
- .LFB1498:
- pushq %rbp
- .seh_pushreg %rbp
- movq %rsp, %rbp
- .seh_setframe %rbp, 0
- subq $64, %rsp
- .seh_stackalloc 64
- .seh_endprologue
- call __main
- leaq -16(%rbp), %rax
- movl $2, %r8d
- movl $1, %edx
- movq %rax, %rcx
- call _ZN7point_tC1Ell
- leaq -32(%rbp), %rax
- movl $4, %r8d
- movl $3, %edx
- movq %rax, %rcx
- call _ZN7point_tC1Ell
- leaq .LC4(%rip), %rdx
- movq .refptr._ZSt4cout(%rip), %rcx
- call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
- movq %rax, %rcx
- leaq -16(%rbp), %rax
- movq %rax, %rdx
- call _ZNSolsEPKv
- movq .refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(%rip), %rdx
- movq %rax, %rcx
- call _ZNSolsEPFRSoS_E
- leaq .LC5(%rip), %rdx
- movq .refptr._ZSt4cout(%rip), %rcx
- call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
- movq %rax, %rcx
- leaq -32(%rbp), %rax
- movq %rax, %rdx
- call _ZNSolsEPKv
- movq .refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(%rip), %rdx
- movq %rax, %rcx
- call _ZNSolsEPFRSoS_E
- leaq -16(%rbp), %rax
- movq %rax, %rcx
- call _ZN7point_t5printEv
- leaq -32(%rbp), %rax
- movq %rax, %rcx
- call _ZN7point_t5printEv
- movl $0, %eax
- addq $64, %rsp
- popq %rbp
- ret
- .seh_endproc
- .def _Z41__static_initialization_and_destruction_0ii; .scl 3; .type 32; .endef
- .seh_proc _Z41__static_initialization_and_destruction_0ii
- _Z41__static_initialization_and_destruction_0ii:
- .LFB1919:
- pushq %rbp
- .seh_pushreg %rbp
- movq %rsp, %rbp
- .seh_setframe %rbp, 0
- subq $32, %rsp
- .seh_stackalloc 32
- .seh_endprologue
- movl %ecx, 16(%rbp)
- movl %edx, 24(%rbp)
- cmpl $1, 16(%rbp)
- jne .L7
- cmpl $65535, 24(%rbp)
- jne .L7
- leaq _ZStL8__ioinit(%rip), %rcx
- call _ZNSt8ios_base4InitC1Ev
- movq .refptr.__dso_handle(%rip), %r8
- leaq _ZStL8__ioinit(%rip), %rdx
- movq .refptr._ZNSt8ios_base4InitD1Ev(%rip), %rcx
- call __cxa_atexit
- .L7:
- nop
- addq $32, %rsp
- popq %rbp
- ret
- .seh_endproc
- .def _GLOBAL__sub_I_main; .scl 3; .type 32; .endef
- .seh_proc _GLOBAL__sub_I_main
- _GLOBAL__sub_I_main:
- .LFB1920:
- pushq %rbp
- .seh_pushreg %rbp
- movq %rsp, %rbp
- .seh_setframe %rbp, 0
- subq $32, %rsp
- .seh_stackalloc 32
- .seh_endprologue
- movl $65535, %edx
- movl $1, %ecx
- call _Z41__static_initialization_and_destruction_0ii
- nop
- addq $32, %rsp
- popq %rbp
- ret
- .seh_endproc
- .section .ctors,"w"
- .align 8
- .quad _GLOBAL__sub_I_main
- .ident "GCC: (GNU) 7.4.0"
- .def _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc; .scl 2; .type 32; .endef
- .def _ZNSolsEPKv; .scl 2; .type 32; .endef
- .def _ZNSolsEPFRSoS_E; .scl 2; .type 32; .endef
- .def _ZNSolsEl; .scl 2; .type 32; .endef
- .def _ZNSt8ios_base4InitC1Ev; .scl 2; .type 32; .endef
- .def __cxa_atexit; .scl 2; .type 32; .endef
- .section .rdata$.refptr._ZNSt8ios_base4InitD1Ev, "dr"
- .globl .refptr._ZNSt8ios_base4InitD1Ev
- .linkonce discard
- .refptr._ZNSt8ios_base4InitD1Ev:
- .quad _ZNSt8ios_base4InitD1Ev
- .section .rdata$.refptr.__dso_handle, "dr"
- .globl .refptr.__dso_handle
- .linkonce discard
- .refptr.__dso_handle:
- .quad __dso_handle
- .section .rdata$.refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_, "dr"
- .globl .refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
- .linkonce discard
- .refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_:
- .quad _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
- .section .rdata$.refptr._ZSt4cout, "dr"
- .globl .refptr._ZSt4cout
- .linkonce discard
- .refptr._ZSt4cout:
- .quad _ZSt4cout
复制代码 |
|