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

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
Tomahomae
Very interested
Posts: 65
Joined: Sat Jan 27, 2018 2:50 am
Location: Russia

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

Post 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 679 times
Last edited by Tomahomae on Sun Mar 30, 2025 8:07 am, edited 1 time in total.
Chilly Willy
Very interested
Posts: 2989
Joined: Fri Aug 17, 2007 9:33 pm

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

Post 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. :?
Tomahomae
Very interested
Posts: 65
Joined: Sat Jan 27, 2018 2:50 am
Location: Russia

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

Post by Tomahomae »

Can I see the peace of code you try to "feed" an ASMX?
Chilly Willy
Very interested
Posts: 2989
Joined: Fri Aug 17, 2007 9:33 pm

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

Post 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
Tomahomae
Very interested
Posts: 65
Joined: Sat Jan 27, 2018 2:50 am
Location: Russia

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

Post 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
Chilly Willy
Very interested
Posts: 2989
Joined: Fri Aug 17, 2007 9:33 pm

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

Post 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.
Tomahomae
Very interested
Posts: 65
Joined: Sat Jan 27, 2018 2:50 am
Location: Russia

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

Post 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 7013 times
Chilly Willy
Very interested
Posts: 2989
Joined: Fri Aug 17, 2007 9:33 pm

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

Post 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.
Post Reply