most popular 6502 assembler

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
pokey
Posts: 7
Joined: 13 Nov 2017

most popular 6502 assembler

Post by pokey »

Hello everyone!
I need to generate some 6502 assembly code for my project, and I (due to lack of experience) is totally clueless about which assembler to target.
A safe choice probably would be to pick the most popular one providing it runs on Windows or Linux. Which one would you recommend?
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: most popular 6502 assembler

Post by GARTHWILSON »

Does it need to be free? The best ones aren't necessarily free, but there indeed seem to be some excellent free ones nevertheless, and "free" of course contributes to popularity. One that comes to mind is Andrew Jacobs' As65 assembler for 6502, 65c02, and 65816, which has program-structure capability built in. I have not used it myself (I use C32 which costs $99) but the specifications for As65 look outstanding, and it has been out for many years, so I would expect it to be relatively bug-free by now.
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?
pokey
Posts: 7
Joined: 13 Nov 2017

Re: most popular 6502 assembler

Post by pokey »

GARTHWILSON wrote:
Does it need to be free? The best ones aren't necessarily free, but there indeed seem to be some excellent free ones nevertheless, and "free" of course contributes to popularity. One that comes to mind is Andrew Jacobs' As65 assembler for 6502, 65c02, and 65816, which has program-structure capability built in. I have not used it myself (I use C32 which costs $99) but the specifications for As65 look outstanding, and it has been out for many years, so I would expect it to be relatively bug-free by now.
Thank you!
Given that 6502's popularity peaked a few decades ago I assumed that all commercial assemblers were abandoned long ago.
I expect that most of my code will be generated and not hand written, so a simple assembler will suffice. I mostly care about syntax, I need to generate code that is not painful to look at for a seasoned 6502 programmer.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: most popular 6502 assembler

Post by GARTHWILSON »

pokey wrote:
I expect that most of my code will be generated and not hand written, so a simple assembler will suffice. I mostly care about syntax, I need to generate code that is not painful to look at for a seasoned 6502 programmer.
The 6502/65C02/65816 syntax will be pretty uniform, but the assembler directives will vary a little bit from one assembler to another. If you have to adapt 65xx source code to make it assemble on a different assembler, hopefully a text editor's search-and-replace feature will quickly do most of it, after you know what to search for and what to replace those things with. For example, .WORD on some assemblers is DWL on the C32 assembler, for "Define Word(s), Low byte first." Many will use ORG (ORiGin) for telling the assembler what address to start assembling the following section for, while others will use .ORG or *=.

Making your code clear and easy to look at depends on you, not really the assembler. It's something we all need to keep striving for, regardless of what level we're at so far. Visual factoring is important. See the last few paragraphs of the "Debugging" page of my 6502 primer, under "Debugging. Part III. An ounce of prevention..."
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?
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: most popular 6502 assembler

Post by BigEd »

There are lots of tools listed in the reference section of 6502.org - start here:
http://6502.org/tools/

Personally I usually use ca65 (part of the cc65 compiler) or any of several in-browser assemblers.
pokey
Posts: 7
Joined: 13 Nov 2017

Re: most popular 6502 assembler

Post by pokey »

BigEd wrote:
There are lots of tools listed in the reference section of 6502.org - start here:
http://6502.org/tools/

Personally I usually use ca65 (part of the cc65 compiler) or any of several in-browser assemblers.
The assembler accepts the standard 6502/65816 assembler syntax

Good enough for me. Thank you!
pokey
Posts: 7
Joined: 13 Nov 2017

Re: most popular 6502 assembler

Post by pokey »

GARTHWILSON wrote:
The 6502/65C02/65816 syntax will be pretty uniform
That's great, thank you
User avatar
cbmeeks
Posts: 1254
Joined: 17 Aug 2005
Location: Soddy-Daisy, TN USA
Contact:

Re: most popular 6502 assembler

Post by cbmeeks »

So, is your handle any reference to a certain audio/IO chip for the Atari? :-)
Cat; the other white meat.
whartung
Posts: 1004
Joined: 13 Dec 2003

Re: most popular 6502 assembler

Post by whartung »

pokey wrote:
Good enough for me. Thank you!
Well, to be honest, you need to consider the ultimate destination for your assembly, in terms of the final form.

The CC65 suite is quite powerful, but the linking and loading can be very complicated.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: most popular 6502 assembler

Post by BigEd »

For simple projects, I've used ca65 in a very simple way. (For more complex ones, you might need to set up a config file which describes your target machine.) See here:

Code: Select all

ca65 -l boot816.as -D BASE=0x8000
cl65 boot816.o --target none --start-addr 0x8000 -o boot816.bin
Elsewhere in the forum, these conversations might help:
viewtopic.php?p=25277#p25277
viewtopic.php?p=51226#p51226
viewtopic.php?t=2455#p24636
User avatar
Druzyek
Posts: 367
Joined: 12 May 2014
Contact:

Re: most popular 6502 assembler

Post by Druzyek »

I can second the recommendation for ca65. The macro system is really powerful and you will probably start using it sooner than you think.
User avatar
BigDumbDinosaur
Posts: 9426
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: most popular 6502 assembler

Post by BigDumbDinosaur »

Long-time user of Kowalski's assembler. It doesn't directly support the 65C816, but has an extensive macro capability that makes adding support possible.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: most popular 6502 assembler

Post by Martin_H »

I've been reading the CA65 docs as it comes with CC65. It does look pretty powerful, and supports label scope, anonymous labels, macros, and program sections. These were all standard features in the best macro assemblers, and are helpful as programs grow in complexity.

I've been using the Ophis assembler as it is written in Python, so it is cross platform. It has a similar feature set and remarkably similar syntax to CA65. A global search and replace should port code from one to the other. For example .endscope (CA65) to .scend (Ophis).
Post Reply