How to Set Up a Cross-Assembler Toolchain..

Post your PE6502 usage suggestions/questions, and also topics related to PE6502 software here.

Moderator: Corneleous

How to Set Up a Cross-Assembler Toolchain..

Postby Corneleous » Thu Oct 05, 2017 3:52 pm

Hello!

There's a lot of software available for these computers on the web. Including MANY different versions of BASIC.

Some of this software, including all of the BASIC interpreters that I've seen, is in 6502 assembly. To assemble this code, you need a cross-assembler, that runs on a modern computer, and allows you to export the assembled file either to a binary file that you would put into the ROM image of the PE6502 (certainly doable, but requires a rom burner, and a little bit of elbow grease!) or into a .mon file that you can upload to the PE6502 over the serial interface directly into RAM through the monitor program that's running at power-on. Then you just have to enter the start address + R (just like you run the BASIC programs in ROM), and run your code.

And, the cross-assembler of choice (in my opinion) is CA65. CA65 is part of the CA65 package, available from its homepage: http://www.cc65.org/
However, you need to patch this version of CC65/CA65, so it will compile for Apple 1/Replica 1 computers (which the PE6502 is SW compatible with). Documentation on how to do this can be found on Jeff Tranter's blog website (Jeff also has an awesome YouTube page by the way!) Jeff's blog page detailing his patch of CC65/CA65 is here: http://jefftranter.blogspot.com/2012/04 ... ica-1.html

Also, while I've seen Windows versions of this cross-compiler, I've personally never been able to get this all to run in Windows. I have been successful in Linux. To have a running Linux computer if all you have is a Windows computer is easy! Download Oracle VirtualBox VM (GNU license, so free to use) from here: https://www.virtualbox.org/ and install Debian Linux. I found this youtube guide to be most helpful, and following will result in a running Linux VM, with a shared folder accessible from both VM and host PC: https://www.youtube.com/watch?v=EE--H1wYKGU&t=848s

Finally, to save you some time, I've tar'd up CC65/CA65 that has been patched for the Apple 1/Replica 1/PE6502. You need to do two things:
1) untar this (http://putnamelectronics.com/ca65.tar.gz) to /usr/local/bin on your Linux VM.
2) untar this (http://putnamelectronics.com/cc65lib.tar.gz) to /usr/local/lib on your Linux VM.
And now, CC65/CA65 should be ready for use from any working directory you create on your Linux VM!

Hope this helps! :)
-=-=-=-=-=-=-=-=-=-
Jason Putnam
putnamelectronics
-=-=-=-=-=-=-=-=-=-
Corneleous
 
Posts: 29
Joined: Sat Sep 30, 2017 4:53 pm
Location: East Coast, USA

Re: How to Set Up a Cross-Assembler Toolchain..

Postby sbprojects » Wed Nov 01, 2017 4:35 am

May I recommend my own cross assembler, the SB-Assembler, which runs on Windows, Linux and Mac. It can directly produce code understood by the original Apple 1.

The SB-Assembler can be found at http://www.sbprojects.net/sbasm/

I have also written a stripped down version of the SB-Assembler which can directly run on the Apple 1, and very likely on the PE6502.

That version can be found at http://www.sbprojects.net/projects/apple1/a1asm.php
sbprojects
 
Posts: 1
Joined: Wed Nov 01, 2017 4:25 am


Return to PE6502 Single Board Computer - Usage and Software

Who is online

Users browsing this forum: No registered users and 2 guests