Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. (14 points] The C++ program below was created in Micro Microsoft Visual Studio running on a 32 bit Intel The program was stopped at

image text in transcribed
image text in transcribed
5. (14 points] The C++ program below was created in Micro Microsoft Visual Studio running on a 32 bit Intel The program was stopped at the indicated location in methods. Portions of the memory as shown in the table. Answer the questions about the per the table. Answer the questions about the program at that point. Note an Intel processor is a Little Endian machine (integers and addin machine (integers and addresses are byte reversed) and the stackgrows towards smaller addresses Y int crow = ?, raven - ?, robin; Stack Activation Frame Format int methodA (int x, int y); int methodB (int z); locals The local variables of the method. This can vary in size. int methodA (int dog, int cat) { Frame pointer The address of the previous int goat, COW; activation frame. goat = dog + cat; COW methodB (goat); Return address The address of the instruction after the method call in the calling return COW; program int methodB (int bull) { parameter 2 The second parameter to the int horse; method // Execution is stopped here parameter 1 The first parameter to the method int main() { robin - methodA (crow, raven); The addresses of the methods are shown in the table to the right. At the point where the program stopped, the EBP register, which points to the frame pointer in the current activation frame, contains 00012360 methodB 00801000 methodA 00801400 main 00801800 addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 00012350 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 00012360 90 23 01 00 60 14 80 00 07 00 00 00 CC CC CCCC 00012370 CC CCCC CC CCCC CCCC CC CCCC CCCC CCCC CC 00012380 CC CC CCCC CC CCCC CC 07 00 00 00 cccccccc 00012390 Co 23 01 00 70 18 80 00 04 00 00 00 03 00 00 00 000123A0 CC CCCC CCCC CCCC CC CCCC CCCC CCCC CCCC What is the value of crow? 4 E 1 What is the value of raven? ake in What is the address in methodA where the call to methods will return well 5. (14 points] The C++ program below was created in Micro Microsoft Visual Studio running on a 32 bit Intel The program was stopped at the indicated location in methods. Portions of the memory n in the table. Answer the questions about the program at that point. Note an Intel processor is a Little Endian machine (integers and addresses are dan machine (integers and addresses are byte reversed) and the stack grows towards smaller addresses. int crow = ?, raven - ?, robin; int methodA (int x, int y); int methodB (int z); int methodA (int dog, int cat) { int goat, COW; goat = dog + cat; COW methodB (goat); return COW; Stack Activation Frame Format locals The local variables of the method. This can vary in size. Frame pointer The address of the previous activation frame. Return address The address of the instruction after the method call in the calling program parameter 2 The second parameter to the method parameter 1 The first parameter to the method int methodB (int bull) { int horse; // Execution is stopped here int main() { robin - methodA (crow, raven); The addresses of the methods are shown in the table to the right. At the point where the program stopped, the EBP register, which points to the frame pointer in the current activation frame, contains 00012360 methodB 00801000 methodA 00801400 main 00801800 addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 00012350 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 00012360 90 23 01 00 60 14 80 00 07 00 00 00 CC CC CCCC 00012370 CC CCCC CC CCCC CCCC CC CCCC CCCC CCCC CC 00012380 CC CC CCCC CC CCCC CC 07 00 00 00 cccccccc 00012390 Co 23 01 00 70 18 80 00 04 00 00 00 03 00 00 00 000123AO What is the value of crow? explain What is the value of raven? What is the address in methodA where the call to methodB will return? well 5. (14 points] The C++ program below was created in Micro Microsoft Visual Studio running on a 32 bit Intel The program was stopped at the indicated location in methods. Portions of the memory as shown in the table. Answer the questions about the per the table. Answer the questions about the program at that point. Note an Intel processor is a Little Endian machine (integers and addin machine (integers and addresses are byte reversed) and the stackgrows towards smaller addresses Y int crow = ?, raven - ?, robin; Stack Activation Frame Format int methodA (int x, int y); int methodB (int z); locals The local variables of the method. This can vary in size. int methodA (int dog, int cat) { Frame pointer The address of the previous int goat, COW; activation frame. goat = dog + cat; COW methodB (goat); Return address The address of the instruction after the method call in the calling return COW; program int methodB (int bull) { parameter 2 The second parameter to the int horse; method // Execution is stopped here parameter 1 The first parameter to the method int main() { robin - methodA (crow, raven); The addresses of the methods are shown in the table to the right. At the point where the program stopped, the EBP register, which points to the frame pointer in the current activation frame, contains 00012360 methodB 00801000 methodA 00801400 main 00801800 addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 00012350 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 00012360 90 23 01 00 60 14 80 00 07 00 00 00 CC CC CCCC 00012370 CC CCCC CC CCCC CCCC CC CCCC CCCC CCCC CC 00012380 CC CC CCCC CC CCCC CC 07 00 00 00 cccccccc 00012390 Co 23 01 00 70 18 80 00 04 00 00 00 03 00 00 00 000123A0 CC CCCC CCCC CCCC CC CCCC CCCC CCCC CCCC What is the value of crow? 4 E 1 What is the value of raven? ake in What is the address in methodA where the call to methods will return well 5. (14 points] The C++ program below was created in Micro Microsoft Visual Studio running on a 32 bit Intel The program was stopped at the indicated location in methods. Portions of the memory n in the table. Answer the questions about the program at that point. Note an Intel processor is a Little Endian machine (integers and addresses are dan machine (integers and addresses are byte reversed) and the stack grows towards smaller addresses. int crow = ?, raven - ?, robin; int methodA (int x, int y); int methodB (int z); int methodA (int dog, int cat) { int goat, COW; goat = dog + cat; COW methodB (goat); return COW; Stack Activation Frame Format locals The local variables of the method. This can vary in size. Frame pointer The address of the previous activation frame. Return address The address of the instruction after the method call in the calling program parameter 2 The second parameter to the method parameter 1 The first parameter to the method int methodB (int bull) { int horse; // Execution is stopped here int main() { robin - methodA (crow, raven); The addresses of the methods are shown in the table to the right. At the point where the program stopped, the EBP register, which points to the frame pointer in the current activation frame, contains 00012360 methodB 00801000 methodA 00801400 main 00801800 addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 00012350 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 00012360 90 23 01 00 60 14 80 00 07 00 00 00 CC CC CCCC 00012370 CC CCCC CC CCCC CCCC CC CCCC CCCC CCCC CC 00012380 CC CC CCCC CC CCCC CC 07 00 00 00 cccccccc 00012390 Co 23 01 00 70 18 80 00 04 00 00 00 03 00 00 00 000123AO What is the value of crow? explain What is the value of raven? What is the address in methodA where the call to methodB will return? well

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions