6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Mar 28, 2024 8:35 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sat Sep 16, 2006 8:18 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
I am finding that the syntax of ACME is starting to get annoying for extensive macro usage. Therefore, I'm currently researching XA65.

However, while the XA65 allows for 65816 opcodes, it doesn't look like it has any equivalent to the .al, .as, .rl, and .rs pseudo-opcodes. These POs are used to convince the assembler that A and X/Y are 16-bit (l) or 8-bit (s). These are analogous to the .LONGA and .LONGI opcodes in other assemblers.

It appears that XA65 completely and totally lacks these features.

Is this correct? Or is the documentation just incomplete?

Thanks.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 16, 2006 10:34 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Apparently so; I found a clone of XA65 for the Super NES called snescom, and it documented the .a(s|l) and .x(s|l) operations. I tried it, and to my surprise, it worked just fine with XA65.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Sep 16, 2006 11:45 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
So, now I'm running into yet another problem with XA:

Code:
;
; FILE cpu.inc
;

#define WDM(v) .byt $42,(v)

Code:
;
; FILE image.a
;

#include "cpu.inc"

    .text
    *=$C000

Foo:
    WDM(170)


The above produces a syntax error, despite being 100% legal C preprocessor syntax (indeed, if I run the code through cpp first, then strip out the cpp-generated metadata, it assembles just as it should!).

I'm using 2.3.0.

If I can't get this to work, well, I don't know what I'll be doing except to go back to ACME.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 17, 2006 1:23 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 985
Location: near Heidelberg, Germany
The XA65 preprocesser actually is not a real C preprocessor.
When I wrote it (way back on the Atari), I did not have a separate cpp
available, so I had to come up with my own code. So there are differences
to cpp.

Looking at your example, the problem probably is the brackets around
the variable "v" in ".byt $42, (v)". Did you try to remove the brackets?
To protect the code you can use block brackets, like:

#define WDM(v) .( :.byt $42,v:.)

or something similar.

Disclaimer: Although it may help you, I actually did not try it out

Andre


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 17, 2006 5:19 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Thanks for the response. I actually ended up moving to ca65 after looking at its macro capabilities.

I did try it without the parentheses as well, plus within and without the scoping blocks. Nothing would convince the assembler to invoke the WDM macro.

I could get parameterless macros working just fine. It seems to have a problem with parameterized macros, at least as it is documented.

Although I very much enjoy using ca65/ld65 right now, I'm thinking I see one flaw with it: it is unable to produce the equivalent of dynamically linked shared libraries. It's not a terribly huge flaw, admittedly, as Amiga-style static libraries can always be used in their place for the time being. Besides, I don't even know if such a thing is possible with .o65 formatted files anyway. :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 18, 2006 9:26 am 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 985
Location: near Heidelberg, Germany
I use dynamic linking with .o65 files in my GeckOS operating system. The kernel as well as the library are linked to the executable binary at load time.

Andre


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jan 10, 2007 5:38 pm 
Offline

Joined: Wed Jan 03, 2007 3:53 pm
Posts: 47
Location: Sunny So Cal
kc, I have confirmed the bug (it was related to another similar bug reported to me by another user) and I have a patch working. I plan to have this fixed by 2.3.2, which should be out in a couple weeks. Andre, I hope to have a test build out to you with the other patches (including yours) maybe by this weekend. I realize this is an old message, but I'm a new user. :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jan 13, 2007 5:00 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
Thanks for the update. I'm a bit too invested in ca65 for the time being to change now though; 240 pages of written text depend on my using ca65. :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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:  
cron