Jump to content
IGNORED

cross assembler for PET development?


Recommended Posts

I'm looking to play around with some assembler programming on my newly-restored PET.  It has the chicklet keyboard, so I'm wanting to do the programming on my laptop via an emulator.  I could run a monitor and attempt to write code that way, but I'd really like to be using a cross-assembler so modern tooling is at my disposal.

 

I'm interested in something relatively OS-agnostic.  My main dev laptop is Linux, and I also use macOS quite a bit.  So something that runs on one or both is what I'm looking for.

 

I found k2xtools / k2asm on github and pulled down the code and was able to build the tool.  From what I read it's pretty full-featured for an assembler.  But no one has contributed to that project for like 5-6 years now, so it seems like a dead toolchain.  What do folks use today to program 6502 assembler targeting commodore 8-bit computers?  Since I'm primarily interested in the PET (for now...) I don't even really need to consider tools for creating graphics artifacts (background, sprites).

 

Thanks!

Link to comment
Share on other sites

3 minutes ago, Rick Reynolds said:

I'm looking to play around with some assembler programming on my newly-restored PET.  It has the chicklet keyboard, so I'm wanting to do the programming on my laptop via an emulator.  I could run a monitor and attempt to write code that way, but I'd really like to be using a cross-assembler so modern tooling is at my disposal.

 

I'm interested in something relatively OS-agnostic.  My main dev laptop is Linux, and I also use macOS quite a bit.  So something that runs on one or both is what I'm looking for.

 

I found k2xtools / k2asm on github and pulled down the code and was able to build the tool.  From what I read it's pretty full-featured for an assembler.  But no one has contributed to that project for like 5-6 years now, so it seems like a dead toolchain.  What do folks use today to program 6502 assembler targeting commodore 8-bit computers?  Since I'm primarily interested in the PET (for now...) I don't even really need to consider tools for creating graphics artifacts (background, sprites).

 

Thanks!

CBM .prg Studio maybe

Link to comment
Share on other sites

Thanks Tuxon86.  I appreciate you chiming in.

 

I did find that tool, but it only runs in windows.  If I don't find anything really good for Linux or Mac, I'll consider doing the assembler dev work in a windows VM via VirtualBox or Parallels.  But I'm looking for something native first.

 

But as another data point, is the CBM .prg Studio THE TOOL that most folks use for this?  Or is there not a real consensus in the commodore 8-bit dev world?  If a tool is pretty much the only one around that the community uses, then it would probably be worth the pain of using a VM just for the community support.

Edited by Rick Reynolds
Link to comment
Share on other sites

2 minutes ago, Rick Reynolds said:

Thanks Tuxon86.  I appreciate you chiming in.

 

I did find that tool, but it only runs in windows.  If I don't find anything really good for Linux or Mac, I'll consider doing the assembler dev work in a windows VM via VirtualBox or Parallels.  But I'm looking for something native first.

Then maybe use CC65 with your favorite text editor?

  • Like 1
Link to comment
Share on other sites

3 minutes ago, Tuxon86 said:

Then maybe use CC65 with your favorite text editor?

Thanks again!  I think I saw cc65 in search results but wrote it off as only a C compiler.  But I see it has an assembler as part of the tool chain that is independent of the compiler, so that's definitely worth a look.

Link to comment
Share on other sites

Just now, Rick Reynolds said:

Thanks again!  I think I saw cc65 in search results but wrote it off as only a C compiler.  But I see it has an assembler as part of the tool chain that is independent of the compiler, so that's definitely worth a look.

All C compilers package that I know include an assembler since it is used in the compilation process of C source code..

Link to comment
Share on other sites

I would probably use good old DASM which branched off into several directions with some attempts to merge all the differences again. I'm not sure which other 6502 cross assemblers are popular today, earlier XA was used by some. The CA65 assembler part of the cc65 package is powerful but a bit complex to use on its own, I believe.

Link to comment
Share on other sites

Thanks carlsson.  I'll give it a look.  I spent some time yesterday with CA65, but couldn't get the linker to produce a valid .prg file.  The output .lst file showed all my code in the right places, so I'm pretty confident that I got the assembly working. But how to turn that .o file into a .prg still eludes me.

Link to comment
Share on other sites

2 hours ago, Rick Reynolds said:

couldn't get the linker to produce a valid .prg file.

 

First 2 bytes of the file need to be the memory address to load into. The address is specified using little-endian format.

http://fileformats.archiveteam.org/wiki/Commodore_64_binary_executable

 

I second DASM, per the latest release notes the last update was in November. We have an AtariAge club for it, Club DASM, which would be the best place to get help with using it.

 

Per DASM's documentation, it defaults to putting the 2 bytes at the start of the file. For 2600 development we have to specify -f3.

 

811018509_ScreenShot2021-05-07at9_52_06AM.thumb.png.7ca6ee20bd00496935e333231948b0ad.png

Link to comment
Share on other sites

Thanks for the input Darrell.  I am targeting a PET, so the default (or -f1) is the right format.  Whatever the cl65 linker was creating as the object file, it was NOT a simple, valid .prg formatted version of the program.

 

I'm happy to report that DASM is working for me now.  Kudos to carlsson for pushing me in the right direction via DMs!

Edited by Rick Reynolds
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...