Please solve this in x86 assembly. Please do not copy from anywhere Problem: Starting with the following C++ program: #i

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Please solve this in x86 assembly. Please do not copy from anywhere Problem: Starting with the following C++ program: #i

Post by answerhappygod »

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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply