I loved that machine.
I have no affiliation other than having purchased the ZX81 manual's art print.
My copy has a "Chapter 26 - Using machine code", and "Appendix A - The character set". The latter also lists all the Z80 opcodes, in both hex and decimal. Those were the really good parts of the book.
I typed in the program, it ran and then the NEW caused the interpreter to reset itself.
I think of it every time I save a file.
And also: "Unfortunately it produces the patterns upside down, but you might not worry about this". C'mon, kid, don't you want to fix that? It'll be fun.
"the program will erase itself - this is to discourage you from using it frivolously."
After typing bilions of lines to have some inventory control (and other things, enough to run a little drugstore) I asked for help to type the remaining code. A relative came, typed "new" and pressed return.
And I absolutely would not want to do an exam on it.
10 PRINT "MARK IS COOL"
20 GOTO 10https://ia904509.us.archive.org/35/items/NH2021_spectrumplus...
(from page 130) a description of calculating how long your ZX Spectrum has been powered on includes a discussion of the problem of a race condition when the counter ticks over
(from page 117) a program illustrating that the RND function uses a pseudo-random number generator
I loved the (similar) ZX81 book so much that I bought a print of the cover art from the (same) original artist.
(Edit: Linked artist's site as a top level comment in case anyone else is interested in getting that)
http://classicacorn.computinghistory.org.uk/8bit_oem_comp/el...
The manual has those clear memory maps and it even describes the way numbers are encoded in the tokenized BASIC program memory, with the exponent sign and mantissa encoding. This really was a remarkable book.
I remember being fascinated by it as a child.
http://www.alisoneldred.com/john-harris/fine-art-prints-1/sc...