MASM - Please fill out the table at the end based off of this information provid
ID: 3800622 • Letter: M
Question
MASM - Please fill out the table at the end based off of this information provided. Thank you!
Create a new project and copy and paste the following code into main.asm.
INCLUDE Irvine32.inc
.data
word1 WORD 10
word2 WORD 20
.code
main PROC
movzx eax,word1
push eax
movzx eax,word2
push eax
call AddTwoArgs
call WriteInt
exit
main ENDP
AddTwoArgs PROC
; Adds two integers, returns sum in EAX.
push ebp ; save stack base pointer
mov ebp,esp ; copy current stack pointer to base
mov eax,[ebp + 12] ; first parameter
add eax,[ebp + 8] ; second parameter
pop ebp ; restore base pointer
ret 8 ; clean up the stack
AddTwoArgs ENDP
END main
At the add eax, [ebp+8] instruction what values are on the stack. Complete the following table.
Displacement
Value Address
+0
+4
+8
+12
Displacement
Value Address
+0
+4
+8
+12
Explanation / Answer
This is the following table filled up at the add eax,[ebp+8] instruction
Displacement Value Address +0 ebp +4 return pointer +8 20 +12 10Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.