
Back to the future: Writing 6502 assembler with Amazon Q Developer
In this short post I have some fun with Amazon Q Developer and get it to write code that runs on my virtual Commodore 64
Have you heard about the AWS Game Builder Challenge? This is a great competition where you need to create a game with AWS services of your choosing: all skill levels welcome!
Amazon Q Chat > Write a simple programming in Commodore 64 basic that displays a sprite moving across the screen smoothly. Make sure the screen is reset first and set to a random colour


Replace uppercase letters with lowercase (the C64 automatically capitalizes)
Illegal quantity error in 200
Here's what this does: (x>255) is a boolean expression that evaluates to -1 when true and 0 when false in Commodore 64 BASIC. The minus sign (-) in front of (x>255) negates this, giving us 1 when x > 255 and 0 when x <= 255. This result (either 0 or 1) is then used as the value for the POKE statement. This correction ensures that the high bit of the sprite's X coordinate is set correctly when the sprite moves beyond the 255th pixel, allowing it to move across the entire width of the screen.
Amazon Q Chat > can you update the code so that there are four sprites in different colours this time. can you make it so that they bounce around the screen
Amazon Q Chat > can you tell me about any online C64 sprite editing tools that I can use to help me create my own sprites?

Amazon Q Chat > convert this commodore basic program to run 6502 assembler that will run on the Vice c64 emulator. I want to use the Kick Assembler tool.
Amazon Q, Send to Prompt > Update the C64 assembler so that there are three sprites rather than one.
Amazon Q Chat interface > provide complete code update
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.