• Home
  • Blog
  • CS 410 SNHU C++ to Assembly with Loops Project

CS 410 SNHU C++ to Assembly with Loops Project

0 comments

In this activity, you will again convert a simple application from C++ into assembly code. This time there are loops within the C++ code. The coding for this assignment will be performed in Codio. You will then download the file from Codio for submission, along with the completed C++ to Assembly With Loops Activity Template Word Document. The following resources will help you complete the tasks in this assignment:

  • Section 7: How to Generate Assembly from C++ Code in the Guide to Software Reverse Engineering
  • Section 8: Downloading and Uploading Files in the Codio Guide

Prompt

Specifically, you must address the following rubric criteria:

  1. Explain the functionality of the C++ code.
    • Use the C++ to Assembly With Loops Activity Template to complete this step.
    • The C++ file is located within the Software Reverse Engineering Playground in the Module Two file folder in Codio. It is also in the following table:
#include<iostream> 
  
using namespace std;

int main()
     {
 int num, i;
 int product=1;
 
cout<<“Enter a number:n”;
cin>>num;
 
 for(i=num;i>0; i--)
  product = product * i;
 
cout<<“The factorial for “<< num << “is: “<< product<< endl; 
 return 0;
}
  1. Convert the C++ file into assembly code.
    • The C++ file can be found in the Software Reverse Engineering Playground in the Module Two file folder in Codio.
  1. Align each line of C++ code with the corresponding blocks of assembly code.
    • Use the C++ to Assembly With Loops Activity Template to complete this step.
  1. Explain how the blocks of assembly code perform the same tasks as the C++ code.
    • Use the C++ to Assembly With Loops Activity Template to complete this step.
    • Consider which blocks of assembly code are skeleton code versus actual parts from the C++ program.

Guidelines for Submission

C++ to Assembly With Loops Activity Template

This should be a Word document. Use this template to explain the functionality of the lines of C++ code, align the lines of C++ code with the corresponding lines of assembly code, and explain how the assembly code performs the same tasks as the C++ code.

Assembly File (S file)

This file is needed to ensure that the C++ code was successfully converted into assembly code.

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}