xa and o65 format (and CC65)

Questions, bug reports, features requests, ... about the Oric Software Development Kit. Please indicate clearly in the title the related element (OSDK for generic questions, PictConv, FilePack, XA, Euphoric, etc...) to make it easy to locate messages.

User avatar
Dbug
Site Admin
Posts: 2389
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: xa and o65 format (and CC65)

Post by Dbug » Thu Apr 13, 2017 1:57 pm

XA 2.2.5 works for me as expected.
Thanks :)
christian wrote:
Thu Apr 13, 2017 1:34 pm
@Dbug: I'm used to use XA and I'm now testing CA65 due to the lack of a real macros support with XA.
Is there any particular macro stuff you are looking for?

There are two things I'd like to add to XA one day: Ability to include binary files directly (incbin) and possibility to repeat a number of lines of code with some variables evaluation - for example to expand a block of lines of code while automatically computing absolute addresses of each instruction -

jede
Flying Officer
Posts: 144
Joined: Tue Mar 14, 2006 11:53 am
Location: France

Re: xa and o65 format (and CC65)

Post by jede » Thu Apr 13, 2017 2:23 pm

Dbug wrote:
Thu Apr 13, 2017 12:08 pm
christian wrote:
Thu Apr 13, 2017 11:39 am
We can also fork co65, modify 1 line and we get a new tool for xa

I'm still not quite sure why Jede is mixing XA and CC65,
In fact, i don't like ca65 syntax, when i code something in assembly, i use xa.

The problem is that i use cc65 for Orix tool (with telemon3.0). I wrote a new tool in assembly, but i need to add command line parameter, i am too lazy to code it in assembly. That is why, i want to link xa code with cc65

User avatar
Dbug
Site Admin
Posts: 2389
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: xa and o65 format (and CC65)

Post by Dbug » Thu Apr 13, 2017 2:31 pm

jede wrote:
Thu Apr 13, 2017 2:23 pm
The problem is that i use cc65 for Orix tool (with telemon3.0). I wrote a new tool in assembly, but i need to add command line parameter, i am too lazy to code it in assembly. That is why, i want to link xa code with cc65
Hmm, so cc65 has native command line support, how does that work exactly?

I assume the command line parameters are written somewhere, like maybe in the BASIC interpreter line buffer, and then it's parsed?

If we can have something standard, we can probably add that to the OSDK, that sound like a reasonable extension to have :)

And yes, ca65 was mostly designed as a "assembler for tools", I can't imagine anyone sane wanting to use write code in ca65 syntax.

jede
Flying Officer
Posts: 144
Joined: Tue Mar 14, 2006 11:53 am
Location: France

Re: xa and o65 format (and CC65)

Post by jede » Thu Apr 13, 2017 2:32 pm

Dbug wrote:
Thu Apr 13, 2017 1:57 pm
XA 2.2.5 works for me as expected.
Thanks :)
christian wrote:
Thu Apr 13, 2017 1:34 pm
@Dbug: I'm used to use XA and I'm now testing CA65 due to the lack of a real macros support with XA.
Is there any particular macro stuff you are looking for?

There are two things I'd like to add to XA one day: Ability to include binary files directly (incbin) and possibility to repeat a number of lines of code with some variables evaluation - for example to expand a block of lines of code while automatically computing absolute addresses of each instruction -
It's a bit tricky to do macro in XA, but 100% of my own needs are working with Xa macro.

christian
Officer Cadet
Posts: 50
Joined: Sun Nov 24, 2013 9:58 pm

Re: xa and o65 format (and CC65)

Post by christian » Thu Apr 13, 2017 2:34 pm

For example, sometimes I need to have strings with last byte having the most significant bit set, or preceded by the length of the string.
I can create 2 macros like:

Code: Select all

.macro string80 arg
        ; Place la chaine avec le bit7 du dernier caratère à 1
        .repeat .strlen(arg)-1, I
                .byte .strat(arg,I)
        .endrepeat
        .byte .strat(arg,.strlen(arg)-1) ^ $80
.endmacro

.macro pstring arg
    .byte strlen(arg)
    .byte arg
.endmacro

Then

Code: Select all

string80 "test"
pstring "test"
is expanded as

Code: Select all

.byte "tes",$74
.byte 4,"test"

jede
Flying Officer
Posts: 144
Joined: Tue Mar 14, 2006 11:53 am
Location: France

Re: xa and o65 format (and CC65)

Post by jede » Thu Apr 13, 2017 2:38 pm

Dbug wrote:
Thu Apr 13, 2017 2:31 pm
jede wrote:
Thu Apr 13, 2017 2:23 pm
I assume the command line parameters are written somewhere, like maybe in the BASIC interpreter line buffer, and then it's parsed?

If we can have something standard, we can probably add that to the OSDK, that sound like a reasonable extension to have :)
Args management are handle here : https://github.com/cc65/cc65/blob/maste ... mainargs.s

Syntax is :

"Command-line arguments can be passed to main(). Since that is not
supported directly by BASIC, the following syntax was chosen:

RUN:REM arg1 " ARG2 IS QUOTED" ARG3 "" ARG5
"

I did the same for telestrat (https://github.com/cc65/cc65/blob/maste ... mainargs.s), but i used BUFEDT buffer (110 bytes in telemon rom). Each program are compiled with this code.

That is why in Orix, i can do "./mybin -x -y"

christian
Officer Cadet
Posts: 50
Joined: Sun Nov 24, 2013 9:58 pm

Re: xa and o65 format (and CC65)

Post by christian » Thu Apr 13, 2017 2:38 pm

I've just realized I'm not using the same version of XA, mine is v2.3.7... :o

User avatar
Dbug
Site Admin
Posts: 2389
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: xa and o65 format (and CC65)

Post by Dbug » Thu Apr 13, 2017 2:57 pm

christian wrote:
Thu Apr 13, 2017 2:38 pm
I've just realized I'm not using the same version of XA, mine is v2.3.7... :o
The OSDK XA is not the same as the "official" XA.

Basically the version in the OSDK is based from the 1998 source code snapshot of XA when André stopped maintaining it.

Fast forward more than a decade, I've been releasing a bunch of updates, fixed a bunch of bugs, etc... and then the official XA reappeared with new maintainers and coders.

I wanted to renamed mine, but that would have caused compatibility problems on my stuff.

Feature wise, I believe the only major difference is the '.bin' command

christian
Officer Cadet
Posts: 50
Joined: Sun Nov 24, 2013 9:58 pm

Re: xa and o65 format (and CC65)

Post by christian » Thu Apr 13, 2017 3:06 pm

Ok, thanks for clarifying.
Yes, the '.bin' command seems to be the only difference

User avatar
Dbug
Site Admin
Posts: 2389
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: xa and o65 format (and CC65)

Post by Dbug » Thu Apr 13, 2017 3:13 pm

What I could do, is to add an explanation on the top of the XA documentation page on OSDK.org explaining that this is not the official version, and redirect people to http://www.floodgap.com/retrotech/xa/ if they want the official one.

christian
Officer Cadet
Posts: 50
Joined: Sun Nov 24, 2013 9:58 pm

Re: xa and o65 format (and CC65)

Post by christian » Thu Apr 13, 2017 3:48 pm

Good idea!

- The last revision is 2.3.7 dated Dec 2014 on http://www.floodgap.com/retrotech/xa/ (no more evolution)
- André put all versions up to v2.3.6 at https://github.com/fachat/xa65 as backup

I will switch to your version and make a package for my Linux distribution.

User avatar
Dbug
Site Admin
Posts: 2389
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: xa and o65 format (and CC65)

Post by Dbug » Thu Apr 13, 2017 4:17 pm


christian
Officer Cadet
Posts: 50
Joined: Sun Nov 24, 2013 9:58 pm

Re: xa and o65 format (and CC65)

Post by christian » Thu Apr 13, 2017 5:31 pm

I'm doing some tests with your latest version (v2.2.5)

Silly program:

Code: Select all

;
; a: AUTOEXEC: 0 / 4
; t: Nom du programme
;


#define TAPE_HEADER(a,t) .db $16, $16, $16, $16, $24, $ff, $ff, $80, a, >end, <end, >start, <start, $09, t, $00
#define TAPE_HEADER_BUG(t,a) .db $16, $16, $16, $16, $24, $ff, $ff, $80, a, >end, <end, >start, <start, $09, t, $00

#define TAPE_TITLE "BRK-HANDLER"
#define AUTOEXEC $04

TAPE_HEADER(AUTOEXEC,TAPE_TITLE)
TAPE_HEADER_BUG(TAPE_TITLE,AUTOEXEC)

start:
	lda #$01
	rts
end:
With original XA, I need to use the command xa -M test.s because of chacracter ':' in comments (MASM compatibility) but it failed with:

Code: Select all

TAPE_HEADER_BUG(TAPE_TITLE,AUTOEXEC)
test.s:line 21: 101a:Syntax error
Never found why TAPE_HEADER_BUG(TAPE_TITLE,AUTOEXEC) failed and TAPE_HEADER_BUG("BRK-HANDLER",AUTOEXEC) pass...

With your version, if I use the same command, it fails too but not for the same reason:

Code: Select all

xAss65: Pass 1: test.s
start:
test.s(23):  1034:Syntax error
end:
test.s(26):  1037:Syntax error
But pass if I type xa test.s without '-M'...

The good news is: your version can pass this test
The not so bad news are: I don't understand the error with your version and '-M' option and why this option is not needed in this case?

User avatar
Dbug
Site Admin
Posts: 2389
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: xa and o65 format (and CC65)

Post by Dbug » Thu Apr 13, 2017 5:53 pm

This option probably got broken when I did some work on the pre-processor to fix some bugs and other weird behavior.
If all -M does is to allow/disallow the parsing of : in commented lines, maybe I should just remove it.

christian
Officer Cadet
Posts: 50
Joined: Sun Nov 24, 2013 9:58 pm

Re: xa and o65 format (and CC65)

Post by christian » Thu Apr 13, 2017 6:38 pm

Yes this is the only function of this option.

As your version handles correctly ':' in comments without the '-M', I think you can remove it or lets it for compatibility only but as a "do nothing function"

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests