Hangman for the Commander X16
Posted: Wed Jan 08, 2020 8:16 pm
Hello everyone!
I thought it would be a fun project to learn 6502 assembly by taking a BASIC program from an old computer book and rewrite the BASIC code line by line in assembler. I'm amazing how much BASIC does for you, even the simplest of functions require some creative thinking to get working in assembler.
I'm not the most creative of people, but it was a great way for me to learn about 8-bit and 16-bit logic. From how to print lines of text on screen, capture user input or how to deal with line and character control (and quirks of the Commander X16 emulator). Trying to add a few small features like a blinking cursor was good fun!
Hangman may not be the most interesting game to play, but i'm curious to hear what you all think about this little project. I've included the files you need to assemble and run it yourself (or just run the binary in the Emulator).
The source code is in the Sources folder, there's a modified version of Keiths BasicFunctions.asm file in the SrcAll file you'll need to assemble the game, since i'm using Keiths PrintChar function, but modified it for some more character and line control. I've also included the Font bitmap in the ResAll folder if you don't have Keiths DevTools. There's also a build binary in the BldX16 folder. You can run the binary in the Commander X16 Emulator r35 or r36 (haven't tried any older versions).
Looking forward to read your tips and advice to improve my understanding of assembler!
Cheers, Marc
I thought it would be a fun project to learn 6502 assembly by taking a BASIC program from an old computer book and rewrite the BASIC code line by line in assembler. I'm amazing how much BASIC does for you, even the simplest of functions require some creative thinking to get working in assembler.
I'm not the most creative of people, but it was a great way for me to learn about 8-bit and 16-bit logic. From how to print lines of text on screen, capture user input or how to deal with line and character control (and quirks of the Commander X16 emulator). Trying to add a few small features like a blinking cursor was good fun!
Hangman may not be the most interesting game to play, but i'm curious to hear what you all think about this little project. I've included the files you need to assemble and run it yourself (or just run the binary in the Emulator).
The source code is in the Sources folder, there's a modified version of Keiths BasicFunctions.asm file in the SrcAll file you'll need to assemble the game, since i'm using Keiths PrintChar function, but modified it for some more character and line control. I've also included the Font bitmap in the ResAll folder if you don't have Keiths DevTools. There's also a build binary in the BldX16 folder. You can run the binary in the Commander X16 Emulator r35 or r36 (haven't tried any older versions).
Looking forward to read your tips and advice to improve my understanding of assembler!
Cheers, Marc