Help me pick an assembler!

Programming the 6502 microprocessor and its relatives in assembly and other languages.
User avatar
Sheep64
In Memoriam
Posts: 311
Joined: 11 Aug 2020
Location: A magnetic field

Re: Help me pick an assembler!

Post by Sheep64 »

Greg816v2 on Thu 31 Mar 2022 wrote:
- Preprocessor directives like #include, #define, #ifdef, etc
It is possible to invoke a C pre-processor separately, for example, to use your favorite assembler with C style directives. The laziest way to do this is cc -E
fachat
Posts: 1124
Joined: 05 Jul 2005
Location: near Heidelberg, Germany
Contact:

Re: Help me pick an assembler!

Post by fachat »

Maybe I'm late but there still is xa65. Includes preprocessor statements. Lacks macros but those can be defined with #define.
Anonymous labels are there in my dev branch, maybe you can help me convince Cameron Kaiser to include them

Oh, and xa comes with ubuntu Linux :-)

André
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
fachat
Posts: 1124
Joined: 05 Jul 2005
Location: near Heidelberg, Germany
Contact:

Re: Help me pick an assembler!

Post by fachat »

Having said that, in my personal style I'm still using #ifdef, but not defining constants with the preprocessor anymore. I'm using normal labels instead and have the benefit of scoping (yes xa has scopes defined with .( and .) )
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
gfoot
Posts: 871
Joined: 09 Jul 2021

Re: Help me pick an assembler!

Post by gfoot »

I've liked using xa. Local labels were very effective and allowed me to easily define modules with public and private symbols, as well as short range jump targets without needing unique names. It was also easy to export a symbol table for my OS so that programs loaded later from SD card could be built against it.

I need to try ca65 sometime though as I'm sure it can also do all of this too. It's on my bucket list.
fachat
Posts: 1124
Joined: 05 Jul 2005
Location: near Heidelberg, Germany
Contact:

Re: Help me pick an assembler!

Post by fachat »

I think only xa65 and ca65 have the capability to produce relocatable o65 files. I.e. relocatable once on load. I know it's an edge case ...
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
vbc
Posts: 80
Joined: 23 Apr 2020

Re: Help me pick an assembler!

Post by vbc »

Greg816v2 wrote:
I've been using ACME to write code for a 6502 board, and as the project grows I'm running into more issues with how ACME works (such as very odd behavior when separating the project into different files). I'm trying to look at all the assemblers out there but I just feel like I'm missing something.

Hoping for the following:

- Support for 65C02 and 65816
- Runs on/can be compiled on Linux
- Uses as standard syntax as possible
- Preprocessor directives like #include, #define, #ifdef, etc
- Anonymous labels (i.e. +/-). After using this in ACME I don't think I can do without it.
- The option to generate an output binary that includes a block of address space assembled to. I.e. for an EEPROM, I have code at $8000 and vectors at $FFFA..$FFFF and the output is a 32K binary.

Every assembler I come across is lacking one of these, but I'm sure they exist, so... what are y'all using :D
FYI, Frank just added support for 65816 to vasm. You may want to have a look at the latest daily snapshot at http://sun.hasenbraten.de/vasm
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Help me pick an assembler!

Post by GARTHWILSON »

vbc wrote:
FYI, Frank just added support for 65816 to vasm. You may want to have a look at the latest daily snapshot at http://sun.hasenbraten.de/vasm
Are you sure? '816' is not found anywhere on your linked page.
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?
vbc
Posts: 80
Joined: 23 Apr 2020

Re: Help me pick an assembler!

Post by vbc »

GARTHWILSON wrote:
vbc wrote:
FYI, Frank just added support for 65816 to vasm. You may want to have a look at the latest daily snapshot at http://sun.hasenbraten.de/vasm
Are you sure? '816' is not found anywhere on your linked page.
Yes. The support has just been added some days ago. It is not yet included in the release versions and the web page has not been updated, but the daily source snapshot does contain the code.
handyandy
Posts: 113
Joined: 14 Sep 2015
Location: Virginia USA

Re: Help me pick an assembler!

Post by handyandy »

There’s also Merlin 32: http://brutaldeluxe.fr/products/crossdevtools/merlin/

Cheers,
Andy
6502user
Posts: 33
Joined: 28 Aug 2022

Re: Help me pick an assembler!

Post by 6502user »

Hi.

Can you help me also, please?

I'm starting to compile some code with the CCA65's CA65. When I compile it without MAcros, all is working ok. But if I use macros the macros don't be compiled (but the process don't give error.
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Help me pick an assembler!

Post by BigDumbDinosaur »

6502user wrote:
Hi.

Can you help me also, please?

I'm starting to compile some code with the CCA65's CA65. When I compile it without MAcros, all is working ok. But if I use macros the macros don't be compiled (but the process don't give error.

Are you compiling C code, or are you assembling?  Compiling and assembling are two different things.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
Proxy
Posts: 746
Joined: 03 Aug 2018
Location: Germany

Re: Help me pick an assembler!

Post by Proxy »

can you post some example code and the commands you use to assemble?
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Help me pick an assembler!

Post by BigEd »

A listing output from a small example would be helpful too.
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Help me pick an assembler!

Post by drogon »

6502user wrote:
Hi.

Can you help me also, please?

I'm starting to compile some code with the CCA65's CA65. When I compile it without MAcros, all is working ok. But if I use macros the macros don't be compiled (but the process don't give error.
You need to generate a listing file and have a look there. Use the -l flag like: -l file.l on the command-line with the rest of the ca65 command.

Then you should see the macro expansion - however note that ca66 will only show the bytes gnerated and not the actual assembler macro expansion..

Here is an example of a macro definition:

Code: Select all

.macro  waitBaud
.local  loop
        ldy     sBaud
loop:   dey
        bne     loop
.endmacro
and what it looks like in the code:

Code: Select all

 ; Delay 1 bit time
        waitBaud
so just one line of the macro name.

And this is what it looks like in the listing file:

Code: Select all

00005Br 1               ; Delay 1 bit time
00005Br 1               
00005Br 1  A4 rr 88 D0          waitBaud
00005Fr 1  FD           
The rr just means a relocatable value but if you were to disassemble that it would look like:

Code: Select all

        ldy     $EA
L109C:  dey
        bne     L109C
(and here you can see the relocatable value is $EA - not really important here)

Hope that helps.

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
6502user
Posts: 33
Joined: 28 Aug 2022

Re: Help me pick an assembler!

Post by 6502user »

drogon wrote:
You need .....

Here is an example of a macro definition: .....and what it looks like in the code:.....

Hope that helps. Gordon
Hi.

That helped me. Thanks.
Last edited by 6502user on Sat Jan 13, 2024 11:29 am, edited 2 times in total.
Post Reply