diff --git a/CM2005 Object Oriented Programming/Topic 1/1.1.5/main.cpp b/CM2005 Object Oriented Programming/Topic 1/1.1.5/main.cpp new file mode 100644 index 0000000..e943738 --- /dev/null +++ b/CM2005 Object Oriented Programming/Topic 1/1.1.5/main.cpp @@ -0,0 +1,11 @@ +#include + +int main() +{ + std::cout << "Hello BSc CS" << std::endl; + return 0; +} + +/* +We use the command "g++ main.cpp" to build the executable +*/ \ No newline at end of file diff --git a/CM2005 Object Oriented Programming/Topic 1/1.1.5/main.s b/CM2005 Object Oriented Programming/Topic 1/1.1.5/main.s new file mode 100644 index 0000000..cb265ba --- /dev/null +++ b/CM2005 Object Oriented Programming/Topic 1/1.1.5/main.s @@ -0,0 +1,117 @@ + .file "main.cpp" + .text + .section .rdata,"dr" +_ZStL19piecewise_construct: + .space 1 +.lcomm _ZStL8__ioinit,1,1 + .def __main; .scl 2; .type 32; .endef +.LC0: + .ascii "Hello BSc CS\0" + .text + .globl main + .def main; .scl 2; .type 32; .endef + .seh_proc main +main: +.LFB1573: + pushq %rbp + .seh_pushreg %rbp + movq %rsp, %rbp + .seh_setframe %rbp, 0 + subq $32, %rsp + .seh_stackalloc 32 + .seh_endprologue + call __main + leaq .LC0(%rip), %rdx + movq .refptr._ZSt4cout(%rip), %rcx + call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc + movq .refptr._ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(%rip), %rdx + movq %rax, %rcx + call _ZNSolsEPFRSoS_E + movl $0, %eax + addq $32, %rsp + popq %rbp + ret + .seh_endproc + .def __tcf_0; .scl 3; .type 32; .endef + .seh_proc __tcf_0 +__tcf_0: +.LFB2063: + pushq %rbp + .seh_pushreg %rbp + movq %rsp, %rbp + .seh_setframe %rbp, 0 + subq $32, %rsp + .seh_stackalloc 32 + .seh_endprologue + leaq _ZStL8__ioinit(%rip), %rcx + call _ZNSt8ios_base4InitD1Ev + nop + addq $32, %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: +.LFB2062: + 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 .L6 + cmpl $65535, 24(%rbp) + jne .L6 + leaq _ZStL8__ioinit(%rip), %rcx + call _ZNSt8ios_base4InitC1Ev + leaq __tcf_0(%rip), %rcx + call atexit +.L6: + 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: +.LFB2064: + 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: (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0" + .def _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc; .scl 2; .type 32; .endef + .def _ZNSolsEPFRSoS_E; .scl 2; .type 32; .endef + .def _ZNSt8ios_base4InitD1Ev; .scl 2; .type 32; .endef + .def _ZNSt8ios_base4InitC1Ev; .scl 2; .type 32; .endef + .def atexit; .scl 2; .type 32; .endef + .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