Page 1 of 1

Who's ordered an expansion ASMX architectural base? :)

Posted: Thu Feb 13, 2025 2:26 pm
by Tomahomae
I hope it may some help for 32X, Saturn, and perspectively - maybe, even the Dreamcast devs.

The best place to download an ASMX sources is here.

To fully integrate a newly-downloaded asmsh.c source file in ASMX, just add the

Code: Select all

ASSEMBLER(SH);
line to arches list in asmx.c file.
asmsh.rar
(3.51 KiB) Downloaded 847 times

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Mon Mar 10, 2025 5:49 pm
by Chilly Willy
Very nice. In case you have trouble finding it, the line goes in asmx.c at line 532 as part of the AsmInit() function.

One caveat - it doesn't accept gas syntax... or apparently old Hitachi syntax... as a matter of fact, I'm having trouble finding which syntax it's using. Maybe you can clarify that. :?

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Sun Mar 30, 2025 8:02 am
by Tomahomae
Can I see the peace of code you try to "feed" an ASMX?

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Mon Mar 31, 2025 9:49 pm
by Chilly Willy
sh2_fixed.s - an example of gas format
https://pastebin.com/RhrBM7bB

int_m.src - hitachi assembler format (most SEGA's libs for 32X and Saturn are in this format)
https://pastebin.com/1tuKMYHw

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Thu Apr 03, 2025 8:19 am
by Tomahomae
Chilly Willy wrote: Mon Mar 31, 2025 9:49 pm sh2_fixed.s - an example of gas format
https://pastebin.com/RhrBM7bB

int_m.src - hitachi assembler format (most SEGA's libs for 32X and Saturn are in this format)
https://pastebin.com/1tuKMYHw
In the case of GAS source file:
[*]ASMX uses a ; as a mark of commentary instead of !, /* and */.
[*]align and constant lenght specifying pseudo-ops, including long doesn't require dot as a prefix in ASMX.
[*]The ASMX equivalent of .section may be the SEG/RSEG/SEG.U pseudo-op (I just never use a rom division by sections before)
[*]I also doubt that there is a something similar to subs division by global and local in ASMX

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Mon Apr 07, 2025 5:06 pm
by Chilly Willy
Thanks. Knowing the syntax asmx uses for SH will allow us 32X/Saturn/DC folks to modify our code to work for cases where we want to use asmx instead of gas or shasm.

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Fri Apr 11, 2025 10:24 am
by Tomahomae
Chilly Willy wrote: Mon Apr 07, 2025 5:06 pm Thanks. Knowing the syntax asmx uses for SH will allow us 32X/Saturn/DC folks to modify our code to work for cases where we want to use asmx instead of gas or shasm.
Now I'm trying to add the PowerPC - the heart of Sega Model 3 arcade hardware - architecture support (this arch assembly module is rewritten by the go ARM module, so the source file for a while still have many "tails" of it), but there is a problem with o, ., a and l postfixes for some commands - compiled ASMX exe file perfectly understand these commands without of postfixes, but the same commands with them for this time gives an error. Where can be the root of problem?
asmppc.zip
(4.27 KiB) Downloaded 7159 times

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Thu Apr 17, 2025 9:11 pm
by Chilly Willy
I can see one error already. Look at this code

Code: Select all

        case o_ThreeReg:
            oldLine=linePtr;
            GetWord(word);
            reg1=FindReg(word,"O");
            if(reg1==0) parm=parm|0x400;
            else linePtr=oldLine;
            
            GetWord(word);
            reg1=FindReg(word,".");
            if(reg1==0) parm=parm|1;
            else linePtr=oldLine;
Okay... remember that if code is a period or O/o, it is NOT a string. Your other compares elsewhere look like this

Code: Select all

             oldLine=linePtr;
             if (GetWord(word) == 'O') parm=parm|0x400;
             else linePtr=oldLine;
             if (GetWord(word) == '.') parm=parm|1;
 
So you can't pass word to FindReg() as it expects the first arg to be a string. It's a character, not a string, so it's not null terminated.

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Sun Jun 08, 2025 3:14 pm
by Chilly Willy
Any word on the PPC support? Or do you need more help finding issues?

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Tue Jun 10, 2025 12:50 pm
by Tomahomae
Chilly Willy wrote: Sun Jun 08, 2025 3:14 pm Any word on the PPC support? Or do you need more help finding issues?
How should I to detect an o or . postfix instead?

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Tue Jun 10, 2025 9:52 pm
by Chilly Willy
The first block of quoted code correctly checks strings. The second quoted code is the problem code that is trying to pass integers to a string function.

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Wed Jun 11, 2025 2:38 am
by Tomahomae
Chilly Willy wrote: Tue Jun 10, 2025 9:52 pm The first block of quoted code correctly checks strings. The second quoted code is the problem code that is trying to pass integers to a string function.
I replaced the code from second quote with a code from first, and all the same getting a same error. Here is a test source for the each ASM command translation checking.
ppc.zip
(286 Bytes) Downloaded 50 times

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Thu Jun 12, 2025 8:45 pm
by Chilly Willy
That wasn't the only place with that error. I was just pointing out the first instance and that anything like it would need to be fixed. I'll go through it and find the others and check against the test code.

Re: Who's ordered an expansion ASMX architectural base? :)

Posted: Fri Jun 13, 2025 7:30 am
by Tomahomae
Chilly Willy wrote: Thu Jun 12, 2025 8:45 pm That wasn't the only place with that error. I was just pointing out the first instance and that anything like it would need to be fixed. I'll go through it and find the others and check against the test code.
Thank you! I look for this moment.