6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 6:23 pm

All times are UTC




Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Fri Apr 15, 2022 1:13 pm 
Offline
User avatar

Joined: Tue Aug 11, 2020 3:45 am
Posts: 311
Location: A magnetic field
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

_________________
Modules | Processors | Boards | Boxes | Beep, Beep! I'm a sheep!


Top
 Profile  
Reply with quote  
PostPosted: Sat May 07, 2022 6:47 am 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 990
Location: near Heidelberg, Germany
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/


Top
 Profile  
Reply with quote  
PostPosted: Sat May 07, 2022 6:49 am 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 990
Location: near Heidelberg, Germany
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/


Top
 Profile  
Reply with quote  
PostPosted: Sat May 07, 2022 9:02 am 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
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.


Top
 Profile  
Reply with quote  
PostPosted: Sat May 07, 2022 2:16 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 990
Location: near Heidelberg, Germany
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/


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 08, 2022 6:35 pm 
Offline

Joined: Thu Apr 23, 2020 5:04 pm
Posts: 45
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


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 08, 2022 7:46 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 08, 2022 8:37 pm 
Offline

Joined: Thu Apr 23, 2020 5:04 pm
Posts: 45
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.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 09, 2022 8:40 am 
Offline

Joined: Mon Sep 14, 2015 8:50 pm
Posts: 110
Location: Virginia USA
There’s also Merlin 32: http://brutaldeluxe.fr/products/crossdevtools/merlin/

Cheers,
Andy


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 11, 2024 10:35 pm 
Offline

Joined: Sun Aug 28, 2022 7:30 pm
Posts: 25
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.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 12, 2024 2:56 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8144
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 12, 2024 4:07 am 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 745
Location: Germany
can you post some example code and the commands you use to assemble?


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 12, 2024 8:24 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
A listing output from a small example would be helpful too.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 12, 2024 9:56 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1399
Location: Scotland
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:
.macro  waitBaud
.local  loop
        ldy     sBaud
loop:   dey
        bne     loop
.endmacro


and what it looks like in the code:

Code:
 ; 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:
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:
        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/


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 12, 2024 8:57 pm 
Offline

Joined: Sun Aug 28, 2022 7:30 pm
Posts: 25
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.

Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: