Question: int var1 = 15; // 32-bits int var2 = OxA; int var3 = -7; short var4 = 17; // 16-bits short var5 = -21; short

int var1 = 15; // 32-bits int var2 = OxA; int var3 = -7; short var4 = 17; // 16-bits short var5 = -21; short var6 = @x31; long var7 = 1; // 64-bits long var8 = -5; long varg = 15; long var10; // uninitialized //#include int main() { vari += var2; var3++; var1 = (var1 - 4) + var3; var4 += 20; var5 -- --var4; var6 = (var5 - var6) + (var4 2); var7 += (var8-- + ++var9); var10 = var 7 + var8 + var9; std::cout cout cout cout cout cout cout cout cout vari endl; // 15 endl; // 10 endl; // -6 endl; // 36 endl; // -57 endl; // -72 varz endl; // 12 vars endl; // -6 varg endl; // 16 return; }

First Assembly Program

Please see the attached C++ program, first.cpp. Write an assembly program that produces the same results as the code in this program. In other words, you should allocate memory locations by the same name and of the same type shown in this program, and carry out equivalent operations to change those memory locations in the same way. Note that the iostream library and cout statements are commented out. We have not yet seen mechanisms to produce output in assembly programs. However, if you uncomment those parts of the C++ program, you can see values of the variables. When writing the assembly program, use the debugger to verify that the named memory locations result in the same values that are produced by the C++ program. Include comments in your assembly code to explain how you are implementing the equivalent C++ code. You might include a comment that includes the C++ statement just before your group of instructions that carries out the equivalent assembly code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!