November 4th, 2024

Back to the future: Writing 6502 assembler with Amazon Q Developer

The author used Amazon Q Developer to enhance a Commodore 64 program, transitioning from BASIC to 6502 assembler, and encourages participation in the AWS Game Builder Challenge for game development.

Read original articleLink Icon
Back to the future: Writing 6502 assembler with Amazon Q Developer

The article discusses the author's experience using Amazon Q Developer to write code for the Commodore 64, a vintage computer. The author initially created a simple program in C64 BASIC that displayed a sprite moving across the screen. After encountering issues, they sought assistance from Amazon Q, which provided solutions and corrections. The author then enhanced the program to include multiple sprites and explored online tools for sprite editing. Transitioning to 6502 assembler, the author utilized the Kick Assembler tool and VSCode to improve performance, successfully running a program with bouncing sprites. The post highlights the potential of Amazon Q Developer for modernizing legacy code and encourages readers to participate in the AWS Game Builder Challenge, a competition for creating games using AWS services.

- The author successfully used Amazon Q Developer to write and debug code for the Commodore 64.

- The transition from BASIC to 6502 assembler improved the performance of the sprite program.

- Amazon Q Developer proved to be a valuable tool for coding and troubleshooting.

- The AWS Game Builder Challenge invites participants of all skill levels to create games using AWS services.

- The post emphasizes the potential of modern tools to assist in working with legacy programming languages and systems.

Link Icon 11 comments
By @nxobject - 5 months
This raises the question: what information did Amazon Q ingest to be able to write C64 Basic, and from where – OCR'd books and magazine off Google Books? Online tutorials? That would explain whether it would be possible to adapt this workflow to supporting other relatively obscure platforms, with a limited documentation set that's certainly not available online on the internet in easily parsable HTML: e.g. PDP-11 assembly, Turbo Pascal, classic Macintosh/Macintosh Toolbox, etc.

Who knows, it might be a shot in the arm for retrocomputing enthusiasts.

By @vardump - 5 months

  // Zero page variables
  .const zp_x = $FB
  .const zp_y = $FE
  .const zp_dx = $101
  .const zp_dy = $104
AI extended zero page, I see… (zp_dx and zp_dy are in 6502 hardcoded stack range, not in zero page at all).
By @094459 - 5 months
Author of the post here. Just reading the comments so apologies for getting some of the terminology wrong. The intention was never to mislead folk , just wanted to share my enthusiasm for emulation and the fact that you could get working code.
By @mxl9df - 5 months
Interesting article, but the title is a bit off. "Assembler" actually refers to the tool that converts assembly language into machine code, not the language itself. So "writing 6502 assembler" would technically mean writing the assembler software, not writing assembly code for the 6502 processor.

It's a small distinction, but surprising to see this mix up as assembly language enthusiasts tend to be sticklers for these details!

By @PaulHoule - 5 months
Reminds me a lot of BASIC I wrote back in the day, particularly the code for the bouncing sprite.

Seriously though it makes me think of how hit-or-miss Microsoft Copilot is at writing code (we have a special license to use it at work.)

For certain things such as writing short bash, CMD.EXE and PowerShell scripts it does great. It writes great list comprehensions in Python. Can convert code defining a set of typed dicts to a set of dataclasses. Can write a SQL query using an obscure (to me) feature and then rewrite it in JooQ.

But write a CTE expression in JooQ? It doesn't understand how to break the circularity.

Configure Vite? It will insist on the same wrong answers ceaselessly. On the other hand, if you look at StackOverlow the answer seems to be "you can't get here from there" or "there is this plugin that might help if it worked but it doesn't."

By @russellbeattie - 5 months
Shout out to Ben Eater for enabling me to understand this article. Everything I know about Assembly and the 6502, I learned from his videos.

https://eater.net/

By @Ambix - 5 months
I did started learning 6502 assembler back in those days :)

Recently I have been busy writing the emulator in Golang:

https://github.com/gotzmann/6502

By @NikkiA - 5 months
They needed to ask Q to know why (x>255) failed in a poke? I despair.
By @cpldcpu - 5 months
Which LLM is Amazon Q based on?
By @CyberDildonics - 5 months
Where does the future come in to this? This title seems like a stretch.
By @johnea - 5 months
I'm really into retro computing!

I use my fingers and 9 small rocks...