![]() |
![]() |
#1 |
BoingBagged
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
|
68020 to 68000 code convertion using Ira and PhxAss
Hi, I am complete rookie on assembly programming, so please forgive my ignorance:
I was wondering how to dissassemble and convert to 68000 an executable/library that was originaly designed for the 68020. I am using ira and PhxAss (both latest versions). What I am doing with no success is the following: ira -m68000 foo phxass foo.asm m=0 opt 0 The end result is a buggy executable/library that fails to run properly on a 68000. So, is there a more or less automatic way of doing what I want to achieve with these programs? I would apreciate any input ![]() |
![]() |
![]() |
#2 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Hi Gulliver,
Quote:
http://www.heywheel.com/matthey/Amiga/ADis.lha For a library, you would type: ADis -m6 -l foo.library ADis works better for disassembling and reassembling IMO. It's very convenient to turn off branches with -d2 and let vasm re-optimize them all after making changes. I usually use vasm in normal mode with esc sequences turned off when recompiling. PhxAss usually does ok but vasm is safer and optimizes more including branches in both directions. There is no easy way to convert from 68020 to 68000 that I'm aware of. It's usually quite a pain actually. Sometimes extra registers are needed and none are free like this: add.l d2,(8,a0,d0.l*4) The 68000 doesn't have *4 so something like this is needed: move.l d0,d1 lsl.l #2,d1 add.l d2,(8,a0,d1.l) If you can't determine that you have a free data register then you have to save one to the stack and restore it after using. Also, do you know that the alignment is not odd? It's difficult to tell and even more of a pain. There are some easier cases like if you find: extb.l d0 You can change to: ext.w d0 ext.l d0 You picked a quite high degree of difficulty to start. It's much easier to go the other way with 68000 to 68020. Not that I know of. Even if there was an automatic process there would be some danger in disassembling and reassembling without reviewing the disassembly for errors. With that said, ADis will give a flawless disassembly of libraries ready to assemble most of the time. |
|
![]() |
![]() |
#3 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Quote:
What exactly is it you want to do? |
|
![]() |
![]() |
#4 | |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
I haven't personally found it very useful anyway. So you might get away with not worrying about that. Then again I don't even use any of the 68020's fancy new addressing modes apart from scaled index. Important additions to instruction set are: bitfield instructions, longword multiplies and divides, and EXTB (very useful). There is also the mysterious CALLM/RTM which was introduced in 68020 and then dropped again in 68030, what the thinking was behind that I can but wonder. |
|
![]() |
![]() |
#5 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Neither have I but this is not relevant here as it doesn't help the OP with his question.
For 68020 to 68000 conversions this does have to be taken into account! |
![]() |
![]() |
#6 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,954
|
|
![]() |
![]() |
#7 |
BoingBagged
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
|
Thank you all for your comments and suggestions.
My goal was to downconvert to 68000 the following files: workbench.library 45.132 Iprefs 45.13 picture.datatype 45.17 This would have proven useful for running an improved workbench experience under 68000. I was extremely naive to think it would be so easy, as there is so much more involved as you have shown me ![]() Thanks again ![]() |
![]() |
![]() |
#8 |
Registered User
Join Date: May 2010
Location: Czech Rep
Posts: 599
|
It would be great to convert Dungeon Master 2 executable from 020+ to 000, to be able to run on Minimig..
Only just dreaming.. |
![]() |
![]() |
#9 | ||
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
Quote:
Code:
move.l (A0),D0 addq.l #2,A0 lsr.l #8,D0 move.l (A0)+,D1 Last edited by Mrs Beanbag; 10 April 2014 at 23:08. |
||
![]() |
![]() |
#10 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,954
|
Why?
Quote:
Edit: For 688030. Last edited by Thorham; 11 April 2014 at 14:47. |
|
![]() |
![]() |
#11 | ||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Quote:
Quote:
So am I actually. WB 3.x works on ECS Amigas as you can use Kickstart 3.1 in non-AGA machines without problems. There might be different WB3.x versions for 68000 and 680x0 machines though. |
||
![]() |
![]() |
#12 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
|
|
![]() |
![]() |
#13 | |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,326
|
Quote:
gulliver wants something like this example but easier: The 68000 icon.library from PeterK. Disassembled V45 (68020+) rewritten/optimized and later made 68000 compatible. |
|
![]() |
![]() |
#14 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,954
|
68030 (Blizzard 1230 IV, 60ns RAM).
Quote:
In the case of the code blocks above, I've tested both, and odd addressing is faster. Didn't even know that until I tried it. |
|
![]() |
![]() |
#15 | |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 880
|
Quote:
|
|
![]() |
![]() |
#16 | ||
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
Table 7-3. Memory Alignment Influence on Noncachable and Writethrough Bus Cycles Transfer Size | Number of Bus Cycles -------------| $0* $1* $2* $3* ------------------------- Instruction 1 N/A N/A N/A Byte Operand 1 1 1 1 Word Operand 1 2 1 2 Long-Word Operand 1 3 2 3 *Where the byte offset (A1 and A0) equals this encoding. It appears that an odd address from a longword access can generate 3 bus cycles while an unaligned even address would only generate 2. The 68020 has no data cache so perhaps it feels this pain more? The 68060 appears to use the store buffer to help with some writethrough and non-cacheable (imprecise?) misaligned accesses. The MC68060UM later states the penalty for writethrough as the same as copyback: Quote:
![]() |
||
![]() |
![]() |
#17 |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 880
|
I wanted to emphasis on that 'move.l ($...2),dn' is also a misaligned transfer.
Yes, for writes to non copyback memory a 'move.l dn,($...1)' will need 3 transfers. All the above examples were reads. As long you have a data cache (30-60) and the memory is cacheable the both misaligned accesses in my example should take the same amount of cycles I think. I agree totally that alignment should be considered ![]() |
![]() |
![]() |
#18 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
|
![]() |
![]() |
#19 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,954
|
What do you mean by inconsiderate?
Quote:
With this alignment crap you really have to run some speed tests. I must admit that I didn't do that before this thread ![]() |
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
68000 code optimisations | pmc | Coders. Asm / Hardware | 248 | 17 September 2023 13:20 |
68000 & 68020 comparaison ? (for GhostsNGhosts temporary freeze) | CFou! | Coders. Asm / Hardware | 7 | 20 February 2013 11:35 |
68000 boot code | billt | Coders. General | 15 | 05 May 2012 20:13 |
"16-32BIT Microprocessors: 68000/68010/68020" | RedskullDC | Coders. General | 5 | 21 June 2008 23:59 |
PhxAss 4.42 | AmiGer | Coders. General | 1 | 15 October 2004 08:07 |
|
|