Question: Consider the following assembly code. There are two functions in the code - main and func 1 ( remember that we execute the main function
Consider the following assembly code. There are two functions in the code main and funcremember that we execute the main function before anything else
Your task is to determine what data is on the stack and registers when running the program right before the line of code at address xf marked by a
Answer the below questions by drawing the stack and filling in the register values. Assume that the initial value of all stack memory is zero x Give all your answers in hexadecimal.
The assembly code is loaded in a portion of RAM named Text Segment
Dump of assembler code for function func:
xfa : push rbp xfb : mov rsprbp xfc : subq xrspxfe : mov rdi, xrbpx: mov esi, eax x: mov alxcrbpx: movq $xbxrbpxf : movb $xaxcrbpx: mov $xfeax x: pop rbp x: leave xa : retq
Dump of assembler code for function main:
xa : push rbp xb : mov rsprbp xe : mov $xesi x: mov $xedi x: callq xfa xd : mov $xeax x: pop rbp x: retq
Function frames are loaded in a portion of RAM named Stack
xfffffffea
x
xfffffffea
x
xfffffffea
xb
xfffffffea
xfffffffea
xfffffffea
xd
xfffffffea
xfffffffeab
xfffffffeaa
x
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
