Learning Challenge: ZX Spectrum machine code: Day 5

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?

1980s dude looking at a screen

Re-enactment of me typing in the code into the monitor

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:

Book listing vs. Monitor and Disassembler listing

Book listing vs. Monitor and Disassembler listing

And I was like...

1980s dude making his 'O' face with the video game

Re-enactment of me seeing the results

Sometimes I really like computers.

(scenes from Parker Brothers "Star Wars Arcade Game" Commercial)


links

social