c262f98t3 - CSc 262 Test 3 20 November 1998 >SUGGESTED...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSc 262 Test 3 20 November 1998 >>>>>>>>>>SUGGESTED ANSWERS<<<<<<<<<<<<<<<<<<<<< 1. (40 pts) In this question I ask you to provide the details of the activation records for the Pascal program below. Beside each statement in the program is the (hypothetical) decimal address for the start of the machine code for the statement. For example, the start of the code that includes instructions for leaving PROCEDURE ONE is 1290. Write a description of the stack of activation records with three columns. The first column should be labeled "memory address" and have the decimal address of the first byte of the given structure. The second column should be labeled "item" and name the item which is being stored in the memory location. The third column should be labeled "value" and have the numerical (or character) value stored in the memory location (provided it can be computed). Assume that CHARs take one byte of memory, INTEGERs two bytes, REALs four bytes, and addresses four bytes. Assume that the base (beginning) address of the stack is 4000. If the program below is executed it goes into infinite recursion. Write the details of the stack when the calling sequence main->two->three->one->two has occurred, and we are at the line marked with machine address 1070 (before the call THREE). Assume that static chains are used for implementing non-local references. In the next question, I ask you to do the exact same thing, except using displays for
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/09/2008 for the course CSC 262 taught by Professor Varies during the Spring '08 term at Lehigh University .

Page1 / 4

c262f98t3 - CSc 262 Test 3 20 November 1998 >SUGGESTED...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online