16. In which one of the 3 types of memory are static variables stored? ( heap, s
ID: 3911449 • Letter: 1
Question
16. In which one of the 3 types of memory are static variables stored? ( heap, stack, program )
17. There are two things the NOP instruction accomplishes while doing nothing – what are they?
18. Given that cl=0x9F, what is the minimum value that when subtracted, would set the OVERFLOW flag?
19. Afterwards, what is the value of the SIGN flag?
20. What is the difference between a compare instruction and a subtract instruction? _______
Short Answer (50 pts)
21. (6 pts) Given the memory shown below and esp = 0x12F458. What is value of eax after executing a “pop
eax” instruction? What is esp after executing the pop instruction?
0012F454 FE CA B0 CA AD BE CE D1 eax = __________ esp = __________
22. (19 pts) Given that [ ebp + 0x14 ] refers to a parameter named “tmpi” = 0x9FEC5, ebp = esp = 0x19000.
CODE A: CODE B: .
lea ecx, [ebp + 0x14] vs. mov ecx, [ebp + 0x14]
push ecx push ecx
call func1 call func1
a. (5 pts) Briefly describe the difference between the CODE A instructions and the CODE B instructions.
b. (4 pts) For each one, show the value of ecx as it appears on the stack.
Stack CODE A: CODE B:
0x18FFC
0x19000 Prior ebp Prior ebp
c. (5 pts) What is the stack address that will hold the return address when func1 is called?
d. (5 pts) At what address is tmpi stored?
Explanation / Answer
Please Note: You have posted more than one Question. As per Chegg Answering Guidelines, I have answered the first question. Please Post Separate for other Questions.
16. In which one of the 3 types of memory are static variables stored? ( heap, stack, program )
Answer)
The static variables are stored in memory:
heap
The static variables are stored in the heap which are referenced by the class definitions.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.