06 July 2024, 09:42 | #1 |
Registered User
Join Date: May 2013
Location: Kleppe / Norway
Posts: 274
|
68020+ support
When writing programs, typically in C, for Amiga with 68020+ as target,
is there more to it than compilation flags and maybe some inline assembly? For existing programs that lack 68000 support, would many of them work with just a re-compile for tat CPU, or is the situation more nuanced? |
06 July 2024, 10:18 | #2 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,504
|
Huh? The 68020 assembler is a superset of the 68000 assembler (except one instruction, but that's not used by compilers anyhow). Which means that if you write programs in assembler, and you want them to run on any 68K member, you can only use 68000 instructions. If you want it to run faster on the 68020+, you can also use 68020+ instructions - but it then works on the 68020+ only.
For compilers, it is quite the same - you can tell them what the target platform should be, and that determines which instructions they can use. Sometimes avoiding or enabling certain instructions or scheduling instructions differently can also help to improve the execution speed, e.g. bitfield instructions on the 68060 are relatively slow compared to other instructions. Some compilers have options to use a particular instruction subset, but still schedule instructions such that the code runs (slightly) faster on the advanced members without using their instructions. Anyhow: There is no need to recompile code designed for the 68000 to run on newer members, and generally, you do not have the sources for recompilation either. |
06 July 2024, 10:57 | #3 | ||
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,761
|
Quote:
If the program targets AmigaOS < 4 and is written entirely in C, there should be no problem recompiling it.* Inline Assembly (for a non-Motorola CPU) will have to be translated to 68k or C. Quote:
If there's a 68020 version there isn't much; typically if the program changes SR (Status Register), accesses words/longwords at odd addresses (allowed on 68020+), or relies on stack frames being a certain fixed size, you will have to have a look. Inline 68020 Assembly might use one of the few extra instructions here and there, but these can usually be easily rewritten (for a performance loss ofc, reason for making new CPU models innit?) So set to 68000, recompile, test. If you find something fix it. Shouldn't be too much. * Usual C compiler caveat, it usually finds some reason to not compile innit? Last edited by Photon; 06 July 2024 at 15:29. |
||
06 July 2024, 14:33 | #4 |
Registered User
Join Date: May 2013
Location: Kleppe / Norway
Posts: 274
|
Thanks.
Photon: Yes, adding 68000 support to existing C programs to run on fast 68000 systems was what I had in mind when asking those questions. |
06 July 2024, 15:24 | #5 |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,134
|
Then the only good solution its reasembling existed 68020 execs.
All other solutions will be only partially works or will be very slow. You can start f.e from Dungeon Master 2 and creating 68000 version of exe. |
06 July 2024, 15:25 | #6 | |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,761
|
Quote:
There was a time when this wasn't so and Aminet was full of useful programs, but only if you had a 68020+. I would say graphical web browsing is not practical with anything less than a 68060. And many websites will be bloated even in text mode. But e.g. Lynx is one that lacks a 68000 port (on Aminet), and might be useful in conjunction with a collection of non-bloated useful information sites, HTML versions of .guides, etc. Unfortunately no mention of Amiga sources on the official website. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A1000 68020 | Marchie | support.Hardware | 6 | 10 November 2017 12:08 |
68020+ instruction timings? | oRBIT | Coders. Asm / Hardware | 3 | 23 September 2017 12:38 |
Overclocking 68020? | Marchie | support.Hardware | 8 | 11 October 2016 13:33 |
Providing 2 fire button support / cd32 joypad support | amigapd | request.Other | 0 | 13 July 2015 17:20 |
Portaudio support (was: WinUAE support for ASIO drivers) | Amiga1992 | support.WinUAE | 57 | 28 March 2009 21:15 |
|
|