Which assembler could I possibly use ?

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
vespacla
Posts: 10
Joined: 22 Sep 2014
Location: Germany

Which assembler could I possibly use ?

Post by vespacla »

I have always written my programs for various SBC 6502 projects with Kowalski 6502 and then run the assembler and burn the ROMs.
Unfortunately Kowalski works worse and worse with wine, on my new Linux system it just hangs and crashes.
Which assembler would you recommend - possibly for Linux - if I have only used Kowalski 6502 so far?
Thank You.
User avatar
cjs
Posts: 759
Joined: 01 Dec 2018
Location: Tokyo, Japan
Contact:

Re: Which assembler could I possibly use ?

Post by cjs »

I very highly recommend the Macroassembler AS, also known as "ASL." It runs on both Unix (including Linux and MacOS) and Windows, is one of the more powerful assemblers out there, and is probably first in the world in terms of the number of CPUs it supports. It's also under active development.

For just 6502 development on either Windows or Unix it's as good as any other assembler, but because it supports both platforms and will assemble code for pretty much any 8- or 16-bit CPU (and some 32-bit CPUs) you might ever imagine using, it means you don't need to change assemblers when you start exploring new things.
Curt J. Sampson - github.com/0cjs
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Which assembler could I possibly use ?

Post by GARTHWILSON »

I have a list of 65xx assemblers on my site's links page, at http://wilsonminesco.com/links.html#assem .  The quantity of them makes it impossible for any one person to be familiar with more than a small percentage of them, to be able to give a complete comparison; but at least you can go "shopping."  I have written a few notes about my observations (from a distance) there.  Unfortunately the one I myself use and like, Cross-32, does not seem to be available anymore, and I would like to find out who owns the rights to it, to ask if I can distribute it, just to keep a good thing going, not particularly to make any money at 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?
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Which assembler could I possibly use ?

Post by BigDumbDinosaur »

vespacla wrote:
Unfortunately Kowalski works worse and worse with wine, on my new Linux system it just hangs and crashes.

Which version of Kowalski are you running?
x86?  We ain't got no x86.  We don't NEED no stinking x86!
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: Which assembler could I possibly use ?

Post by barnacle »

I favour one which is buried in one of Garth's links (damn, we need to find more inventive names for 6502 assemblers!) - as65, http://www.kingswood-consulting.co.uk/assemblers/
  • native linux executable
  • NMOS and CMOS options
  • Macro capability
  • it uses 'traditional' syntax very similar to the Avocet assembler I used forty-odd years ago
So far, my only grumble is that I can't find a way to force an absolute addressing mode when the operand address is on page zero, but it's not insurmountable. It also doesn't do relocatable modules, but I tend to write monolithic code so it's not an issue for me.

Neil
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Which assembler could I possibly use ?

Post by BigEd »

A few more which get a mention in Acorn contexts but are not limited to Acorn environments:
https://github.com/stardot/beebasm (a very popular choice. There's a VS plugin which some find useful)
http://sun.hasenbraten.de/vasm/
https://github.com/SteveFosdick/laxasm
https://github.com/0xC0DE6502/max65-releases
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Which assembler could I possibly use ?

Post by BigEd »

BTW there's a curated list on this site's reference section (6502.org is more than the forum!)
http://6502.org/tools/asm/
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Which assembler could I possibly use ?

Post by drogon »

vespacla wrote:
I have always written my programs for various SBC 6502 projects with Kowalski 6502 and then run the assembler and burn the ROMs.
Unfortunately Kowalski works worse and worse with wine, on my new Linux system it just hangs and crashes.
Which assembler would you recommend - possibly for Linux - if I have only used Kowalski 6502 so far?
Thank You.
I use the ca65 assembler from the cc65 suite natively under Linux. It's a standard package under Devuan/Debian, and probably many others.

If you're familiar with separate compilation, assembly and linking then this may work very well for you. The assembler produces a relocatable object file that you can link with other files to produce an object file in more or less the same way that other tools work under Unix - e.g. gcc (although the command-line options are similar but different).

I've been doing it this way since I got back into the 65xx some years back now. editor, Makefiles and ca65 ... It has useful macro facilities too and will generate code for NMOS, CMOS and '816 CPUs. (Or more precisely give you errors when you use an opcode not supported on your particular target). My largest project is a bytecode VM which assembles to 16KB and is split over 30+ source files to keep everything manageable. the whole thing assembles and links in under a second on my Linux desktop.

If you want to try and want example Makefiles, etc. let me know.

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
User avatar
cjs
Posts: 759
Joined: 01 Dec 2018
Location: Tokyo, Japan
Contact:

Re: Which assembler could I possibly use ?

Post by cjs »

I should mention that I find linking assemblers to be more of a pain than useful for 8-bit work. (I started out with a linking assembler, ASxxxx/AS6502, when I started doing cross-development on Linux a few years back.) The source and object files for 8-bit machines are so small that they both, along with the listing file, fit into the L2 cache on my fifteen-year-old laptop, and the L1 cache on any modern machine, and assembly from scratch is possibly even faster than doing a partial assembly and then a link. So there's no speed advantage there.

What they do do, however, is limit your options for optimisation. This may or may not be a big deal, but if you are occasionally writing programs you want to be as small as possible, avoiding the overhead of the interfaces you need for linking can be helpful. (You need to use a linking system if you're doing part of your program in other languages, such as C, but if you're using C you've already thrown optimisation out the window, anyway.)
Curt J. Sampson - github.com/0cjs
vbc
Posts: 80
Joined: 23 Apr 2020

Re: Which assembler could I possibly use ?

Post by vbc »

vespacla wrote:
I have always written my programs for various SBC 6502 projects with Kowalski 6502 and then run the assembler and burn the ROMs.
Unfortunately Kowalski works worse and worse with wine, on my new Linux system it just hangs and crashes.
Which assembler would you recommend - possibly for Linux - if I have only used Kowalski 6502 so far?
Thank You.
I am not familiar with the specifics of the Kowalski assembler, but vasm works on Linux, supports several syntax styles, many (all?) 6502 variants (apart from other cpu architectures) and a variety of absolute and linkable output formats.
teamtempest
Posts: 443
Joined: 08 Nov 2009
Location: Minnesota
Contact:

Re: Which assembler could I possibly use ?

Post by teamtempest »

Quote:
I favour one which is buried in one of Garth's links (damn, we need to find more inventive names for 6502 assemblers!) - as65, http://www.kingswood-consulting.co.uk/assemblers/

native linux executable
NMOS and CMOS options
Macro capability
it uses 'traditional' syntax very similar to the Avocet assembler I used forty-odd years ago

So far, my only grumble is that I can't find a way to force an absolute addressing mode when the operand address is on page zero, but it's not insurmountable. It also doesn't do relocatable modules, but I tend to write monolithic code so it's not an issue for me.
Since your assembler has macro capabilities, one option to "force" absolute addressing would be to create one which first laid down the correct byte for the opcode, then the 16-bit value of the expression. Something like:

Code: Select all

macro ABS_ADC ?expr
    byte  $6D
    word ?expr
endmacro
Sure, it's a bit more effort on your part, but it does exactly what you want and only when you want it. It's easier if the assembler does it for you. But while on the surface that looks like an easy task, it can be hard to properly error check. And it's a facility that is only rarely used anway, so whoever creates the assembler may consider it more effort than it's worth.
vespacla
Posts: 10
Joined: 22 Sep 2014
Location: Germany

Re: Which assembler could I possibly use ?

Post by vespacla »

Thanks for all your ideas and comments. The version of my Kowalski program is 1.2.11 - I saw somewhere that there is a newer version, but I don't think that's the problem. Using Wine with Kowalski is more the difficulty. I've already experimented with ca65, I don't have the documentation for some other assemblers. I'll have a look at your recommendations.
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Which assembler could I possibly use ?

Post by BigDumbDinosaur »

vespacla wrote:
Thanks for all your ideas and comments. The version of my Kowalski program is 1.2.11 - I saw somewhere that there is a newer version, but I don't think that's the problem. Using Wine with Kowalski is more the difficulty. I've already experimented with ca65, I don't have the documentation for some other assemblers. I'll have a look at your recommendations.

Visit here to download the most recent version of the Kowalski package.  The current version is 1.4.0.6.  You may have better luck with it in WINE.

EDIT: The current version is now 1.4.0.9.
Last edited by BigDumbDinosaur on Sun May 25, 2025 12:36 am, edited 1 time in total.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
kenames99
Posts: 3
Joined: 07 Oct 2021

Re: Which assembler could I possibly use ?

Post by kenames99 »

barnacle wrote:
I favour one which is buried in one of Garth's links (damn, we need to find more inventive names for 6502 assemblers!) - as65, http://www.kingswood-consulting.co.uk/assemblers/
  • native linux executable
  • NMOS and CMOS options
  • Macro capability
  • it uses 'traditional' syntax very similar to the Avocet assembler I used forty-odd years ago
So far, my only grumble is that I can't find a way to force an absolute addressing mode when the operand address is on page zero, but it's not insurmountable. It also doesn't do relocatable modules, but I tend to write monolithic code so it's not an issue for me.

Neil
hi,
you by chance would still have a copy of that assemble from avocet? or know where to get it. I am only hoping. thanks.

Ken
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: Which assembler could I possibly use ?

Post by barnacle »

I wish I had, but it's over forty years since I last used it. As I recall, it was a cross-assembler running on CP/M.

Neil
Post Reply