Day 5 and I realized what was wrong with the ADD section: There's a whole problem missing from the PDF version of the book. Fortunately I have a hard-copy of the book and can see what happened, but it's a little disturbing to see an entire example missing from the book (especially when it says "First problem" and there's no "second problem").
Today was the complement of addition: subtraction. Which is pretty straightforward but it got me thinking of a different approach to playing with Assembly / Machine code on the Spectrum.
I've been a little upset with the ZX Spectrum tools and how they split off the Assembler from the monitor. I'm used to programs like the Atari Assembler Editor where it's a little easier to get to the monitor, but it seems the ZX Spectrum assemblers have the monitor separate (or have a rather weak monitor installed and a separate monitor available separately). So I've been flipping back and forth between the assembler / editor and the monitor using both HISoft's Devpac and Zeus / Monitor and Disassembler.
About midway through I realized for this exercise that I could likely get away with using only the monitor. After all, the program listings for Mastering Machine Code on your ZX Spectrum expects you to just enter the hex codes for the machine code. What if I used the Monitor / Disassembler program to try this out?
So I got to typing using "Edit 7530" and entered the listing shown here. I then typed "Disassemble 7530" to verify the listing was correct. After one false start (BC and HL require two bytes) I got the listing shown here:
And I was like...
Sometimes I really like computers.
(scenes from Parker Brothers "Star Wars Arcade Game" Commercial)