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 func1(remember 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 0x000055555555460f (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 (0x0000000000000000). 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 func1:
0x00005555555545fa <+0>: push %rbp 0x00005555555545fb <+1>: mov %rsp,%rbp 0x00005555555545fc <+2>: subq 0x10,%rsp0x00005555555545fe <+4>: mov %rdi, -0x8(%rbp)0x0000555555554602<+8>: mov %esi, %eax 0x0000555555554604<+10>: mov %al,-0xc(%rbp)0x0000555555554607<+13>: movq $0x7b,-0x8(%rbp)=>0x000055555555460f <+21>: movb $0x7a,-0xc(%rbp)0x0000555555554613<+25>: mov $0x1f,%eax 0x0000555555554618<+30>: pop %rbp 0x0000555555554619<+31>: leave 0x000055555555461a <+32>: retq
Dump of assembler code for function main:
0x000055555555461a <+0>: push %rbp 0x000055555555461b <+1>: mov %rsp,%rbp 0x000055555555461e <+4>: mov $0x2,%esi 0x0000555555554623<+9>: mov $0x1,%edi 0x0000555555554628<+14>: callq 0x5555555545fa 0x000055555555462d <+19>: mov $0x0,%eax 0x0000555555554632<+24>: pop %rbp 0x0000555555554633<+25>: retq
Function frames are loaded in a portion of RAM named Stack
0x7fffffffea70
0x0000000000000000
0x7fffffffea78
0x0000000000000000
0x7fffffffea80
0x000000000000007b
0x7fffffffea88
0x00007fffffffea98
0x7fffffffea90
0x000055555555462d
0x7fffffffea98
0x00007fffffffeab0
0x7fffffffeaa0
0x0000000000000000

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 Programming Questions!