Question: Continue with the lab exercise, write a program that calculates the following expression:A = (A + B) (C + D). Define five (sum, valueA,valueB, valueC,valueD)

Continue with the lab exercise, write a program that calculates the following expression:A = (A + B) (C + D).

Define five (sum, valueA,valueB, valueC,valueD) 32-bit unsignedand, five (ssum,svalueA, svalueB,svalueC, svalueD) 32-bit signedinteger variables. Variable sum (ssum) will be assigned the result at the end of program.

  1. Case 1: valueA = 1000, valueB = 500, valueC = 450, valueD = 100
  2. Case 2: valueA = - 2000, valueB = 100, valueC = 1000, valueD = -500
  3. Case 3: valueA = 1000, valueB = 300, valueC = 2000, valueD = 500

Catch the screenshots from running in debugger mode to identify the values saved in each variable and register are correct after the end of the program. Also how a register represent a negative number, is it correct?

Generate a listing file for the program. Write a description (100~150 words) of the machine code bytes generated from two instructions. (you may open the listing file with any text editor.)

Lab Exercise Example

; AddTwo.asm - adds two 32-bit integers. ; Chapter 3 example

.386 .model flat,stdcall .stack 4096 ExitProcess proto,dwExitCode:dword

.code main proc mov eax,500 mov ebx,200 mov ecx,300

mov edx,400

add eax,ebx

add ecx,edx

sub eax,ecx

invoke ExitProcess,0 main endp end main

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 Databases Questions!