Learn · Volume 1
Section 1.4.1. Subroutines
7 exercises: 7 with a written solution, 0 stated in Lean, 0 proved in Lean.
1. Read first
The companion chapter builds on these. Read the ones you do not know yet.
- P1. Proof, induction and invariants
- C1, Section 1.3.1. Description of MIX draft
- C1, Section 1.3.2. The MIX assembly language draft
2. Read the section
Read Section 1.4.1 in your copy of the book. Then read the companion chapter Subroutines (a draft): it explains each item in the words of the handbook, with examples and proofs. The items of the section and their status.
3. Work the exercises
Section 1.4.1
The exercises of Section 1.4.1 train the use of subroutines on MIX: the calling sequence, the entry and exit conditions, linkage by the J-register, and routines with more than one entrance. Exercises 1 to 3 state the characteristics of the maximum-finding routine of the text. Exercises 2 and 4 add entrances. Exercise 5 shows linkage on a machine without a J-register. Exercise 6 writes the MOVE instruction as a subroutine. Exercise 7 is a discussion of self-modifying code.
All programs in these solutions were written for this handbook and checked on a MIX simulator against the stated conditions. See also the C1 chapter on Section 1.4.1.
A good order is 3, 1, 2, 4, 5, 7, 6.
From the Solutions volume of the handbook. The source.
The list starts with the lowest rating. Try each exercise on paper first. Its page has the hints one at a time, the solution behind a click, and the Lean status.
| Exercise | Rating | Kind | Solution | Lean |
|---|---|---|---|---|
| 1.4.1-1 | 10 | K3 | written | not stated yet |
| 1.4.1-2 | 10 | K6 | written | not stated yet |
| 1.4.1-3 | M15 | K3 | written | not stated yet |
| 1.4.1-7 | 20 | informal | written | not stated yet |
| 1.4.1-4 | 21 | K6 | written | not stated yet |
| 1.4.1-5 | 21 | K6 | written | not stated yet |
| 1.4.1-6 | 26 | K6 | written | not stated yet |
Something is wrong? Report it.