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

Info icon This 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.
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern