Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please provide the full RUNNABLE .asm file (using Intel x86 ). Please provide th

ID: 3804060 • Letter: P

Question

Please provide the full RUNNABLE .asm file (using Intel x86).

Please provide the header and comments:

Note: Submit your source code by only uploading .ASM file using iCollege in the respective assignment dropbox: o Lastname 1.ASM (Ex. mussa 1.ASM), Lastname2.ASM (Ex. mussa2.ASM), Lastname3.ASM (Ex. mussa3 ASM), Lastname4.ASM (Ex. mussa4 ASM) Comment header for ASM files Student: Awad Mussa Class: CSC3210 Assignment 4 Description: This program Follow the program standards as presented in your book. Pay more attention to code comments and consistent indentation.

Explanation / Answer


RUNNABLE Lastname4.asm file (using Intel x86)--------------->

main:
        push      rbp                                           #4.1
        mov       rbp, rsp                                      #4.1
        sub       rsp, 32                                       #4.1
        mov       DWORD PTR [-32+rbp], 6                        #6.7
..B1.2:                         # Preds ..B1.3 ..B1.1
        mov       eax, DWORD PTR [-32+rbp]                      #6.11
        test      eax, eax                                      #6.13
        jg        ..B1.4        # Prob 50%                      #6.13
        jmp       ..B1.7        # Prob 100%                     #6.13
..B1.3:                         # Preds ..B1.5
        mov       eax, -1                                       #6.15
        add       eax, DWORD PTR [-32+rbp]                      #6.15
        mov       DWORD PTR [-32+rbp], eax                      #6.15
        jmp       ..B1.2        # Prob 100%                     #6.15
..B1.4:                         # Preds ..B1.2
        mov       DWORD PTR [-28+rbp], 3                        #8.9
..B1.5:                         # Preds ..B1.6 ..B1.4
        mov       eax, DWORD PTR [-28+rbp]                      #8.13
        test      eax, eax                                      #8.15
        jle       ..B1.3        # Prob 50%                      #8.15
        mov       eax, DWORD PTR [-28+rbp]                      #10.11
        add       eax, DWORD PTR [-32+rbp]                      #10.11
        mov       DWORD PTR [-24+rbp], eax                      #10.7
        mov       eax, -1                                       #8.17
        add       eax, DWORD PTR [-28+rbp]                      #8.17
        mov       DWORD PTR [-28+rbp], eax                      #8.17
        jmp       ..B1.5        # Prob 100%                     #8.17
..B1.7:                         # Preds ..B1.2
        mov       eax, offset flat: std::cout                   #13.7
        mov       edx, DWORD PTR [-24+rbp]                      #13.7
        mov       rdi, rax                                      #13.7
        mov       esi, edx                                      #13.7
        call      std::basic_ostream<char, std::char_traits<char> >::operator<<(int)                                     #13.7
        mov       QWORD PTR [-16+rbp], rax                      #13.7
        mov       eax, 0                                        #14.11
        leave                                                   #14.11
        ret                                                     #14.11
std::__ioinit:

__sti__$E:
        push      rbp                                           #
        mov       rbp, rsp                                      #
        sub       rsp, 16                                       #
        mov       eax, offset flat: std::__ioinit               #74.25
        mov       rdi, rax                                      #74.25
        call      std::ios_base::Init::Init()                       #74.25
        mov       eax, offset flat: std::ios_base::Init::~Init()     #74.25
        mov       edx, offset flat: std::__ioinit               #74.25
        mov       ecx, offset flat: __dso_handle                #74.25
        mov       rdi, rax                                      #74.25
        mov       rsi, rdx                                      #74.25
        mov       rdx, rcx                                      #74.25
        call      __cxa_atexit                                  #74.25
        mov       DWORD PTR [-16+rbp], eax                      #74.25
        leave                                                   #74.25
        ret                                                     #74.25

Output :-

2

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote