Base CS from zero
Control flow: free-recall review
Recall beats re-reading. For each prompt, say or write a full answer from memory before you open the model answer — the effort of pulling it back is what makes the mechanism stick.
Reconstruct the unit’s spine from memory: what execution flow is, how the program counter produces it, how a compare plus a conditional jump makes a branch, how a backward jump makes a loop, and why a loop runs forever.
- 01What is execution flow, and what single thing determines it?
- 02Why is sequential (straight-line) execution the default, and how does the PC produce it?
- 03Explain how an if statement becomes a compare plus a conditional jump at the machine level.
- 04What does 'fall through' mean, and why does an if/else need an unconditional jump after the if-true block?
- 05What makes a loop, and why are while and for the same thing to the CPU?
- 06Why does an infinite loop happen, and can the CPU detect it?
If you could reconstruct each answer from memory, you hold the unit’s spine: execution flow is the order instructions actually run, set entirely by the program counter; the PC advances by default, giving straight-line code; a compare sets a flag and a conditional jump reads it to make a branch; an if/else is two PC destinations with a skip-jump on the boundary; a backward jump plus a top-of-loop test makes a loop, identical for while and for; and a loop runs forever when the tested value never changes — something the CPU can neither count nor detect.