English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 09 October 2013, 21:09   #1
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Tool to convert asm to gnu asm (gas)

I'm looking for some tool which can convert asm source to gnu asm. Mean about some tool (Amiga/PC) which transfer for example

move #33,D0 --> move #33,%D0
clr.l -(sp) --> clrl %sp@-

and so on.
Asman is offline  
Old 10 October 2013, 20:23   #2
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,336
The two types of syntax are sometimes referred to as Motorola and MIT. So you could google something like: mit motorola syntax convert

Doing that brought up mention of a "mit2mot" program which is probably the same one as at http://ftp.back2roots.org/geekgadget...cc/mit2mot.lha. But that converts from Motorola to MIT syntax, not MIT to Motorola. This comp.sys.amiga.programmer thread from 1995 mentions a mot2mit tool, but I couldn't find that yet.

Update: Found it! mot2mit and mit2mot executables are in http://ftp.fi.netbsd.org/pub/amiga/g...cc263-base.lha

Last edited by mark_k; 10 October 2013 at 20:32.
mark_k is online now  
Old 11 October 2013, 16:05   #3
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Asman View Post
I'm looking for some tool which can convert asm source to gnu asm.
Why would you want to do that to your sources? There are free and portable cross assemblers which understand the original syntax.
phx is offline  
Old 11 October 2013, 16:59   #4
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,753
Quote:
Originally Posted by phx View Post
Why would you want to do that to your sources?
Because they want to use gnu asm for something
Thorham is offline  
Old 11 October 2013, 17:07   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
I think you only need d0 -> %d0 conversion. At least gcc (used in aros m68k) supports both syntax in addressing modes, for example clr.l -(%sp) does work.
Toni Wilen is offline  
Old 11 October 2013, 18:11   #6
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
Cross-assembling this:
Code:
_mysprintf:
            movem.l a2-a3/a6,-(sp)

            move.l  4*4(sp),a3
            move.l  5*4(sp),a0
            lea   	6*4(sp),a1
            lea.l   stuffChar(pc),a2
            move.l  _SysBase,a6
            jsr     _LVORawDoFmt(a6)

            movem.l (sp)+,a2/a3/a6
            rts
with this:
m68k-amigaos-as -version
GNU assembler 2.14

works fine.
alkis is offline  
Old 12 October 2013, 12:45   #7
AnimaInCorpore
Registered User
 
Join Date: Nov 2012
Location: Willich/Germany
Posts: 232
You might try the MRI compatibility mode. Also using a good editor to replace the items via the regex replace function would be a good idea.
AnimaInCorpore is offline  
Old 29 December 2020, 19:16   #8
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,170
I'm going to create a python tool to convert MIT to Motorola, to convert Motorola Floating point emulation library so it can be built with vasm.

will be available in my git repo when done.
jotd is offline  
Old 29 December 2020, 19:27   #9
Ernst Blofeld
<optimized out>
 
Ernst Blofeld's Avatar
 
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
Quote:
Originally Posted by jotd View Post
will be available in my git repo when done.
Don't forget to tell 2013 about it when it's ready.
Ernst Blofeld is offline  
Old 29 December 2020, 21:05   #10
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,170
Quote:
Don't forget to tell 2013 about it when it's ready.
I'm going to write it for my own needs. I'll share it when it's done. I'm aware of the mit2mot tool, but I haven't tried it. At any rate a python tool will be more convenient than a tool in amiga executable format (I didn't see the source of that)

and if there are issues, a post-processing will be needed, so...
jotd is offline  
Old 30 December 2020, 00:12   #11
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,170
btw almost through with my little conversion project (to convert motorola fpsp FPU 68040 emulation)

Stumbled on that strange syntax:

Code:
move.l	a1@(d0:l:4),a1
Is that

Code:
move.l (a1,d0.l*4),a1
or

Code:
move.l (a1,d0.l,4),a1
?
jotd is offline  
Old 30 December 2020, 08:56   #12
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,170
found it by assembling with a non amiga 68k gcc and disassembling with ira. It's

Code:
MOVEA.L	(0,A1,D0.L*4),A0
MIT syntax sucks. And mit2mot wasn't even able to convert it either... useless.
jotd is offline  
Old 30 December 2020, 09:19   #13
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,960
Quote:
Originally Posted by jotd View Post
found it by assembling with a non amiga 68k gcc and disassembling with ira. It's

Code:
MOVEA.L	(0,A1,D0.L*4),A0
MIT syntax sucks. And mit2mot wasn't even able to convert it either... useless.
A1 or A0 as destination ? or this assembling bug?
Don_Adan is offline  
Old 30 December 2020, 11:57   #14
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,170
Quote:
Originally Posted by Don_Adan View Post
A1 or A0 as destination ? or this assembling bug?

sorry, I changed the snipped in the meantime. No, no bug.


tool available https://github.com/jotd666/amiga68kt...ols/mit2mot.py


if you convert sources and you have issues contact me or open an issue on github
jotd is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need an ASM manual VoltureX Coders. General 2 17 November 2011 15:24
6502 Asm pmc Coders. General 21 06 November 2008 09:37
ASM Uni Course BippyM Coders. Tutorials 27 18 September 2008 10:37
Newbies to ASM BippyM Coders. Tutorials 24 06 June 2006 21:55
hex2ascii in asm redblade Coders. General 6 30 June 2005 10:56

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:32.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.31865 seconds with 13 queries