Computer Organization and Programming using Visual Studio C++ I need help with n
ID: 3789469 • Letter: C
Question
Computer Organization and Programming using Visual Studio C++
I need help with number 5. Thanks
Link for the code examples and required libraries for the book http://kipirvine.com/asm/gettingStartedVS2015/Irvine.zip
Link for zip file containing a 32-bit Visual Studio 2015 project http://kipirvine.com/asm/gettingStartedVS2015/Project32_VS2015.zip
Using the Add Two program from Section 3.2 as a reference, write a program that calculates the following expression, using registers: (A B)-(C D). Assign integer values to the EAX, EBX, ECX, and EDX registers. l. Click here to download the code examples and required libraries for the book. Unzip the downloaded file into a directory named Irvine on Drive C. 2. Download the program in section 3.2 from Click here to download a zip file containing a 32-bit Visual Studio2015 project 3. Do the following steps, inorder: Start Visual Studio. To begin, open our sample Visual Studio project file by selecting File/open/Project from the Visual Studio menu. Navigate to your working folder where you unzipped our project file, and select the file named Project.sIn. Once the project has been opened, you will see the project name in the Solution Explorer window. You should also see an assembly language source file in the project named Add Two asm. Double-click the file name to open it in the editor. 4. You should see the following program in the editor window: AddTwo. asm adds two 32-bit integers Chapter 3 example 386 model flat,stdcall stack 4096 ExitProcess proto, dwExitcode dword code main proc eax,5 mov add eax, 6 invoke ExitProcess, 0 main endp end mainExplanation / Answer
The following code helps for evaluating the expression A = (A + B)-(C + D)
Note: Here variables A,B,C,D are used instead of immediate values. These variables must be somehow accumulated with any values which are to be evaluated.
main proc
mov eax,[A]
add eax,[B]
mov ecx,[C]
add ecx,[D]
sub eax,ecx
mov [A],eax
invoke ExitProcess,0
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.