Please solve this in x86 assembly. Please do not copy from anywhere Problem: Starting with the following C++ program: #i
Posted: Fri Jul 08, 2022 6:39 am
Please solve this in x86 assembly. Please do not copy fromanywhere
Problem:Starting with the following C++ program:#include <iostream>using namespace std;void main (){unsigned long i1;unsigned long i2;unsigned long i3;unsigned long i4;_asm{}cout << "results are " << (unsigned long) i1 <<", "<< (unsigned long) i2 << ", "<< (unsigned long) i3 << ", "<< (unsigned long) i4 << endl;}Set i1 and i2 to each have a value of 1.Create a loop that will do the following for each iteration of theloop:1) Add 3 to i1 and store the result into i1;2) Multiply i2 by 3 and store the result into i2;Terminate the loop if either i1 becomes greater than 100 OR if boththe followingare true: more than 15 iterations of the loop have occurred AND i2has reached avalue of at least 999999.After the loop terminates do the following:1) Set i3 to the number of times through the loop2) Set i4 to the remainder of i1 divided by i3To Turn In:Rename .cpp file to “COSC 2325– Lab 5 your last name”. Email.cppfile with assembly code to instructor
Problem:Starting with the following C++ program:#include <iostream>using namespace std;void main (){unsigned long i1;unsigned long i2;unsigned long i3;unsigned long i4;_asm{}cout << "results are " << (unsigned long) i1 <<", "<< (unsigned long) i2 << ", "<< (unsigned long) i3 << ", "<< (unsigned long) i4 << endl;}Set i1 and i2 to each have a value of 1.Create a loop that will do the following for each iteration of theloop:1) Add 3 to i1 and store the result into i1;2) Multiply i2 by 3 and store the result into i2;Terminate the loop if either i1 becomes greater than 100 OR if boththe followingare true: more than 15 iterations of the loop have occurred AND i2has reached avalue of at least 999999.After the loop terminates do the following:1) Set i3 to the number of times through the loop2) Set i4 to the remainder of i1 divided by i3To Turn In:Rename .cpp file to “COSC 2325– Lab 5 your last name”. Email.cppfile with assembly code to instructor