taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Learn · Volume 1

Section 1.4.2. Coroutines

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.

2. Read the section

Read Section 1.4.2 in your copy of the book. Then read the companion chapter Coroutines (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.2

The exercises of Section 1.4.2 are about coroutines: routines that call each other as equals and resume where they left off. Exercise 1 asks why good small examples are rare. Exercises 2 and 3 look at details of the text program, the order of start and the use of the comparison indicator. Exercises 4 to 6 are about linkage: on other machines, with a register that must be kept, and for three coroutines. Exercise 7 asks for a program that reverses the translation of the text.

The programs in these solutions were written for this handbook and run on a MIX simulator. The linkage of exercises 5 and 6 and the program of exercise 7 were tested against independent models in Python. See also the C1 chapter on Section 1.4.2.

A good order is 1, 2, 5, 3, 4, 6, 7.

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.

ExerciseRatingKindSolutionLean
1.4.2-110informalwrittennot stated yet
1.4.2-515K6writtennot stated yet
1.4.2-220K3writtennot stated yet
1.4.2-320K2writtennot stated yet
1.4.2-420K6writtennot stated yet
1.4.2-622K6writtennot stated yet
1.4.2-730K6writtennot stated yet

Something is wrong? Report it.