Retro Coding
Published on

Atasm Altirra Bridge

Making coding 6502 assembler a bit easier

When I started relearning 6502 assembler for the Atari 8bit machines in 2021 I had little scripts that assembled and executed my code. My editor of choice is Visual Studio Code and I managed to make the process of running the scripts painless.

Soon I had figured out how to debug my assembler code using the Altirra emulator. Now the process of setting up breakpoints became a burden.

Since VSCode is such a hugely popular editor I figured that someone must have written something to make things easier for a 6502 assembler programmer. Sure there were plenty of extensions that gave you syntax highlighting, allowed you to write C64 code, etc. but nothing for using the Atasm assembler with the Altirra emulator.

Step 1 - Planning

Learn how to code a VSCode extension. Not hard, there are a ton of sample projects and lots of people have published that code on GitHub. I got the gist of it and started putting somethings together.

Key ideas for the extension were:

  • Stay in VSCode for all the coding
  • Give you 6502 and assembler syntax highlighting
  • Run via a keyboard shortcut or and simple GUI
  • Must support breakpoint management.
  • Nice to haves would be symbol searches and memory layout viewer.

Step 2 - Coding the extension

The idea was that the extension should make your 6502 excursions easier and support you in the journey. Writing something simple like this

    * = $2000
BOOT_THIS   
    lda #1
    sta $80
END jmp END

    *=$2e0
    .word BOOT_THIS

saving it away and pressing F5 should get the code running in Altirra.

Does it work?

Yup it does work! Install the extension and check out the documentation in the GitHub repo.

You first steps will be quick and easy and you'll appreciate the F5 run, and the Ctrl+F5 debug feature.

The Symbol Explorer is a powerful tool to navigate your larger source code.

The Memory Viewer shows you the memory layout of the oh so limited 64K. The region naming feature of Atasm makes this a nice feature to use.

    * = $2000 "Game Code"
    ...
    * = $9000 "RMT Music"
null

Using F9 to set a breakpoint and then running your code in debug mode Ctrl+F5 will give you plenty of fun debugging your code.

Future

Should you find the tool useful, leave a comment in GitHub.

If you find a bug or want a special feature let me know.

Links

https://github.com/CycoPH/atasm-altirra-bridge - Atasm-Altirra-Bridge GitHub repo https://marketplace.visualstudio.com/items?itemName=cerebus.atasm-altirra-bridge - The extension