Thanks to everybody who submitted corrections!
They will be included in a future version of the book. Typos and grammatical errors will not be listed here unless they obscure the meaning of the text.
Found something else? Please mail me!
The pop()
function will remove a value from the stack
when one register is allocated, even if the stack is empty, resulting in a
stack underflow. The following code corrects this erratum.
void pop(void) { if (S) { gen("pop R%d"); S--; R--; if (0 == R) R = N; } else { R--; } }