Presentation is loading. Please wait.

Presentation is loading. Please wait.

Implementing Subprograms

Similar presentations


Presentation on theme: "Implementing Subprograms"— Presentation transcript:

1 Implementing Subprograms
Chapter 10 Implementing Subprograms

2 Figure 10.1 An activation record for “simple” subprograms
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

3 Figure 10.2 The code and activation records of a program with “simple” subprograms
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

4 Figure 10.3 A typical activation record for a language with stack-dynamic local variables
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

5 Figure 10.4 The activation record for function sub
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

6 Figure 10.5 Stack contents for three points in a program
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

7 Figure 10.6 The activation record for factorial
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

8 Figure 10.7 Stack contents at position 1 in factorial
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

9 Figure 10.8 Stack contents during execution of main and factorial
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

10 Figure 10.9 Stack contents at position 1 in the program Main_2
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

11 Figure 10.10 Block variable storage when blocks are not treated as parameterless procedures
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

12 Figure 10.11 Stack contents for a dynamic-scoped program
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.

13 Figure 10.12 One method of using shallow access to implement dynamic scoping
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.


Download ppt "Implementing Subprograms"

Similar presentations


Ads by Google