Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Modify the sample program in Figure 3.1 to add two numbers stored in memory at n

ID: 3786508 • Letter: M

Question

Modify the sample program in Figure 3.1 to add two numbers stored in memory at number 1 and number 2: respectively. Continue to store the total in memory at sum. Assemble, link and execute the program Explain the changes that are displayed in registers and memory after execution of each instruction. You should submit your source code and the screen snapshots which show the changes after execution of each instruction along with your explanation.; Example assembly language program; adds 158 to number in memory; Author: R. Detmer; Date: 6/2013 .586 .MODEL FLAT .STACK 4096; reserve 4096-byte stack .DATA; reserve storage for data number DWORD -105 sum DWORD ? .CODE; start of main program code main PROC mov eax, number; first number to EAX add eax, 158; add 158 mov sum, eax; sum to memory mov eax, 0; exit with return code 0 ret main ENDP END Example assembly language program

Explanation / Answer

.586
.MODEL FLAT

.STACK 4096

.DATA
number1 DWORD -105
number2 DWORD -205
sum DWORD ?

.CODE
main PROC
   mov eax,number1
   add eax,number2
   mov sum,eax
   ret
main ENDP

END

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote