09 October 2013, 21:09 | #1 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
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. |
10 October 2013, 20:23 | #2 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,351
|
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. |
11 October 2013, 16:05 | #3 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
|
11 October 2013, 16:59 | #4 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,866
|
|
11 October 2013, 17:07 | #5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,575
|
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.
|
11 October 2013, 18:11 | #6 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 725
|
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 m68k-amigaos-as -version GNU assembler 2.14 works fine. |
12 October 2013, 12:45 | #7 |
Registered User
Join Date: Nov 2012
Location: Willich/Germany
Posts: 236
|
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.
|
29 December 2020, 19:16 | #8 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,388
|
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. |
29 December 2020, 19:27 | #9 |
<optimized out>
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
|
|
29 December 2020, 21:05 | #10 | |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,388
|
Quote:
and if there are issues, a post-processing will be needed, so... |
|
30 December 2020, 00:12 | #11 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,388
|
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 Code:
move.l (a1,d0.l*4),a1 Code:
move.l (a1,d0.l,4),a1 |
30 December 2020, 08:56 | #12 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,388
|
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 |
30 December 2020, 09:19 | #13 |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,054
|
|
30 December 2020, 11:57 | #14 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,388
|
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 |
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 |
|
|