Simple 6502 assembler recommendations?

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
yzoer
Posts: 79
Joined: 11 Nov 2002
Location: Seattle

Simple 6502 assembler recommendations?

Post by yzoer »

Hi all,

I'm working on a variant on a 6502 core and looking for a simple 6502 assembler to customize. Anyone have any recommendations? Preferably in C/C++ with minimal features.

Cheers,

Yvo

P.S. The core itself is (almost) done and I'll post it to opencores / here once I have an assembler. It comes in around ~500LE's on a cyclone II and doesn't use any blockram. Performance comes in around ~70mhz but that's of course gated by memory speed..
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Simple 6502 assembler recommendations?

Post by GARTHWILSON »

If I understand what you're after, I think your best path to success is the Cross-32 (C32) assembler. See http://www.datasynceng.com/c32doc.htm . It's not free, nor terribly expensive ($99), but it not only gives the tables for assembling for lots of different processors when you buy the one assembler, but also provides a way to write your own tables for a processor of your own design. You don't have to do any programming to do it. They say that an entirely new processor should take about 40 hours to set up the tables for; but in your case it should be a lot less since yours is a variant of the 6502 which is already provided for, so you will only need to edit a copy of that table.

There's no need to find a minimal assembler to do what you want. This is a full-featured macro assembler. I've used it a lot and I really like it.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
yzoer
Posts: 79
Joined: 11 Nov 2002
Location: Seattle

Re: Simple 6502 assembler recommendations?

Post by yzoer »

Thanks Garth!

I've used TASM in the interim in DosBox but it's not great because of that. Also, I want to add native support for bank switching and what not.. I'll check out cross32 but it looks like I might need to write my own down the line..

Cheers!

Yvo
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Simple 6502 assembler recommendations?

Post by BigEd »

Have a look at ca65 from the cc65 project.

See also the catalogue nearby: http://6502.org/tools/asm/
scotws
Posts: 576
Joined: 07 Jan 2013
Location: Just outside Berlin, Germany
Contact:

Re: Simple 6502 assembler recommendations?

Post by scotws »

I've been using Ophis (http://michaelcmartin.github.io/Ophis/) to good effect, it's Python-based, though with a slightly different syntax than other assemblers.
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: Simple 6502 assembler recommendations?

Post by Martin_H »

I was using tass, but I got sick of the DOS box overhead, so I looked at both CA65 and Ophis. I think both are good choices as they have a similar feature set (e.g. label scope, anonymous labels, and macros). But they have slightly different use cases in mind.

CA65 generates relative object files that are linked into an executable. This is handy for big projects where you need to compile libraries and link them into several executables. If I was building a ROM run time monitor, a self-hosted language, or DOS, I would choose it. However, I'd also use the make utility to manage the dependencies and command line generation.

Ophis generates an executable directly. It's handy when you are producing a single executable and you don't want the complexity CA65 entails. Forth would be a good example of such a project. Right now it's my go to assembler.
yzoer
Posts: 79
Joined: 11 Nov 2002
Location: Seattle

Re: Simple 6502 assembler recommendations?

Post by yzoer »

Thanks all! I'll keep you posted on any updates...
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Simple 6502 assembler recommendations?

Post by BigEd »

(Ca65 can also be used for simple projects)
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Re: Simple 6502 assembler recommendations?

Post by BitWise »

The materials I posted in the TMNOC contest thread contains a copy of my Java based 65xx assembler and some batch files that build a simple example. It can do a lot more.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: Simple 6502 assembler recommendations?

Post by Martin_H »

BigEd wrote:
(Ca65 can also be used for simple projects)
Yes, it's a completely reasonable choice. I think Ophis is a bit simpler, but that's somewhat subjective.
Post Reply