Question: What is the answer for E and F. Please explain (b) [I pr.I Write down the size of a stackframe of outputseq () . readMinMax

What is the answer for E and F. Please explain

What is the answer for E and F. Please explain (b) [Ipr.I Write down the size of a stackframe of outputseq () .readMinMax () + readhrrsiz() and exam (). ANSWERS: outputSeq(3:___ readminMax (1)___ readArrSiz():__

(b) [I pr.I Write down the size of a stackframe of outputseq () . readMinMax () + readhrrsiz() and exam (). ANSWERS: outputSeq(3:___ readminMax (1)___ readArrSiz():__ exam(1): Qurstions (c) - (i) ask you about the state of the virtual machine at the time of the debugging.stop after execution of 519 instructions: (c) 0.5pt.) What is the data memory address of results [3]? (results is a static variable declared on the 3ni non-blank line of the program on p. 5.) ANSWER: (d) 0.5 pt. ) Name the method whose code is being executed. ANSWER: (c) [0.5 pt. ] What is the data memory address of offset 0 in the currently executing method activation's stackframe? ANSWER: (f) 11 pt.l What are the addresses of the data memory locations that constitute the stackframe of the currently executing method activation? ANSWER: (g) [1.5 pts.] What values are stored in the locations of the formal parameter(s) and local variable(s) of the executing method activation? For each parameter and each local variable, write down its name followed by the value stored in its location: ANSWER: (h) [0.5 pt.] Name the method that called the executing method. ANSWER: (i) [1 pt.] What are the addresses of the data memory locations that constitute the stackframe of the caller? (This must be a stackframe of the method named in (h).) ANS WVER: Now suppose the debugging stop had not occurred after execution of 519 instructions. (j) [1.5 pt.] Write down the code memory addresses of the three instructions that would have been executed next, in the order in which those instructions would have been executed. (ln other words, write down the code memory addresses of the instructions that would have been the 520ih,5215t, and 522nd instructions to be executed, in that order.) ANSWERS: (k) 11 pt.] Immediatelv afler execution of the three instructions you identified in (j), what would ASP and ESP have contained? ANSWERS: ASP: ESP: IMPORTANT: Read the remarks at the bottom of p. 4 before you answer the following questions. (a) [1 pt.] For each of the methods outputseg(), readMinMax (), readArrSiz (), and exam () in the program on the previous page, say how many locations (if any) are allocated in its stackframes to local variables declared within the method's bods. ANSWERS: outputseq (): readMinMax (): readarrsiz(): exam(): therectawa. ut 11. Bctaner? int it =ininax [03; Whito {1 minmax [1],1;; in code memory: Instructions at addresses 196205 syatem.out.printins"Bai anawezt": ; en ae argsreatipin =17 196: PUSHNUM 1 PUSHNUM Inr arraysizefedd - Gi System.put,print ("max num oE terms: "); 202: PUSHLOCADDR if \{arraysize \& 1\} System.out.printini"Bad answer!"'; 204: PUSHSTATADDR 2 205: 205 : LOADFROMADDR System, out, println; "Not enough mem!"?; eise arraysizeread =2; suits = new intlarraysize]; Page 5 of 10 (b) [I pr.I Write down the size of a stackframe of outputseq () . readMinMax () + readhrrsiz() and exam (). ANSWERS: outputSeq(3:___ readminMax (1)___ readArrSiz():__ exam(1): Qurstions (c) - (i) ask you about the state of the virtual machine at the time of the debugging.stop after execution of 519 instructions: (c) 0.5pt.) What is the data memory address of results [3]? (results is a static variable declared on the 3ni non-blank line of the program on p. 5.) ANSWER: (d) 0.5 pt. ) Name the method whose code is being executed. ANSWER: (c) [0.5 pt. ] What is the data memory address of offset 0 in the currently executing method activation's stackframe? ANSWER: (f) 11 pt.l What are the addresses of the data memory locations that constitute the stackframe of the currently executing method activation? ANSWER: (g) [1.5 pts.] What values are stored in the locations of the formal parameter(s) and local variable(s) of the executing method activation? For each parameter and each local variable, write down its name followed by the value stored in its location: ANSWER: (h) [0.5 pt.] Name the method that called the executing method. ANSWER: (i) [1 pt.] What are the addresses of the data memory locations that constitute the stackframe of the caller? (This must be a stackframe of the method named in (h).) ANS WVER: Now suppose the debugging stop had not occurred after execution of 519 instructions. (j) [1.5 pt.] Write down the code memory addresses of the three instructions that would have been executed next, in the order in which those instructions would have been executed. (ln other words, write down the code memory addresses of the instructions that would have been the 520ih,5215t, and 522nd instructions to be executed, in that order.) ANSWERS: (k) 11 pt.] Immediatelv afler execution of the three instructions you identified in (j), what would ASP and ESP have contained? ANSWERS: ASP: ESP: IMPORTANT: Read the remarks at the bottom of p. 4 before you answer the following questions. (a) [1 pt.] For each of the methods outputseg(), readMinMax (), readArrSiz (), and exam () in the program on the previous page, say how many locations (if any) are allocated in its stackframes to local variables declared within the method's bods. ANSWERS: outputseq (): readMinMax (): readarrsiz(): exam(): therectawa. ut 11. Bctaner? int it =ininax [03; Whito {1 minmax [1],1;; in code memory: Instructions at addresses 196205 syatem.out.printins"Bai anawezt": ; en ae argsreatipin =17 196: PUSHNUM 1 PUSHNUM Inr arraysizefedd - Gi System.put,print ("max num oE terms: "); 202: PUSHLOCADDR if \{arraysize \& 1\} System.out.printini"Bad answer!"'; 204: PUSHSTATADDR 2 205: 205 : LOADFROMADDR System, out, println; "Not enough mem!"?; eise arraysizeread =2; suits = new intlarraysize]; Page 5 of 10

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