Question: Using the AddTwo program from Section 3 . 2 as a reference, write a program that calculates the following expression, using the general purpose registers

Using the AddTwo program from Section 3.2 as a reference, write a program that calculates the following expression, using the general purpose registers of the x86 architecture:
EAx=(EAx+EBx)-(ECx+EDx).
Of course, you want to assign integer values to the EAX, EBX, ECX, and EDX registers before you evaluate the expression. Use the following values: EAx=3174,EBx=9825,ECx=4153 and EDX =7936 to test your program.
Insert a call DumpRegs statement to display the register values as shown in the program AddTwo.
(Note: The routine DumpRegs is available in a library of routines provided by the author of the textbook, K. Irvine. Your code should be linked to it through Visual Studio. Review Section 3.2.2).
Below is the AddTwo program referenced in the first question (given in Section 3.2.1):
; AddTwo.asm - adds two 32-bit integers
; Chapter 3 example
.386
model flat,stdcall
. stack 4096
ExitProcess PROTO, dwExitCode:DWORD
DumpRegs PROTO
. code
main PROC
mov eax,5 ; move 5 the eax register
add eax,6 ; add 6 to the eax register
call DumpRegs
INVOKE ExitProcess, 0
main ENDP
END main
PLEASE USE C++
 Using the AddTwo program from Section 3.2 as a reference, write

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!