A course for the Dragon 32 · Chapters 0 to 15
With #: LDA #$41 says “here is the number”. $41 goes into the drawer.
Without #: LDA $0400 says “go to house $0400, copy what is written there, and put it in the drawer”. What goes into the drawer depends on what is in the house at that moment.
This is exactly what you did on the street in Chapter 0: “Photo to the note” and “Write from the note”. LDA $0400 takes a photo of the house, and the house doesn’t change. STA $0401 rubs out and writes.
We wanted to copy the red square from the top left corner to the bottom right corner.
Mistake 1: a hash sign on a house. Someone wanted to copy the corner, and wrote LDA #$0400. With a hash sign it isn’t a house any more, it’s a number. But $0400 is too big for the drawer: it needs more than eight lamps.
What happens in DREAM? No complaint at all. The translator (assembler) keeps only what fits in eight lamps, $00, and an inverse @ appears in the corner (code 0). We copied nothing. ✓ Checked in DREAM
Mistake 2: a hash sign in STA. STA #$0400 means nothing: STA always writes to a house, and has nothing to do with “here is a number”.
Here too DREAM doesn’t complain: it translates the line into a strange code ($87) that has no defined meaning in the 6809 processor. On our Dragon machine nothing was written on the screen. On a real processor the result isn’t guaranteed, so simply don’t write it that way. ✓ Checked in DREAM
Rule of thumb: # = “here is the number”. Without # = “go to the house”. STA never has a hash sign.
In these puzzles the first lines are already written (they draw something on the screen). You carry on after them, and in your lines you may not use #. You may only copy.
$60. So the “empty square” in example 2 really is empty. ✓ CheckedA hobbyist tribute project, not affiliated with or endorsed by Dragon Data. The course, drawings and text are our own. Every program in the course was checked on the site's Dragon machine (XRoar running the BASIC we wrote).