A course for the Dragon 32 · Chapters 0 to 15
By the end of the course you will write this game yourself: a yellow apple falls, and you catch it in a blue basket. You will write it in the language the fast games of 1982 were written in: machine code.
Hello. I’ll be with you all through the course. Sounds hard? Don’t worry. We’ll go slowly: in every step one idea, a picture, and something to press. If you understand how to write a number in a house, you’ve already come most of the way.
Inside the computer there is a very long street of little houses. Every house has a house number, like on a real street.
On every house hangs a small wipeable board, and on it is written one number. Only one, never two. The number is always between 0 and 255.
The Dragon has 65,536 houses like these. The game, the letters on the screen, the sounds: it is all numbers on these boards.
$0400. It is the same number, in the computer’s way of writing. For now you can ignore the small line. We’ll learn it in Chapter 3.When you write a number in a house, the board is wiped first. The old number disappears, and the new one is written in its place.
When the computer reads a number from a house, it doesn’t take the board. It takes a photo of it. The copy goes onto a note in its hand, and the number stays in the house exactly as it was.
Click a house to choose it. Then write a number in it, or take a photo of it onto the note.
Did you try to write 300? The board won’t have it. The biggest number that fits is 255. That isn’t our rule, it is how the Dragon itself works. Why 255 of all numbers? We’ll find out in Chapter 4.
POKE 1024,300 answers ?FC ERROR. In DREAM the line LDA #300 doesn’t complain, but keeps only what fits: 44 (because 300 minus 256). ✓ Both checked on our Dragon machineAt the start, house 1030 holds 4. Now we do, in this order:
Copy the number from house 1029 to house 1033, without typing it. You may only use “Photo to the note” and “Write from the note”.
A 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).