English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 06 July 2024, 09:42   #1
Yulquen74
Registered User
 
Join Date: May 2013
Location: Kleppe / Norway
Posts: 273
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?
Yulquen74 is offline  
Old 06 July 2024, 10:18   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,355
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.
Thomas Richter is offline  
Old 06 July 2024, 10:57   #3
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,723
Quote:
Originally Posted by Yulquen74 View Post
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?
More to what? Sounds like you want to port AmigaOS utilities from a non-Motorola CPU? Then there's more to it. E.g. AmigaOS4 PPC apps, AmigaOS4 will have added some library functions (or entire libs) and maybe an app relies on them. You will then have to bring that support over to 68k as well.

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:
Originally Posted by Yulquen74 View Post
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?
This sounds like fixing "forgotten" 68000 variants of existing C programs. Now that there are 68000 CPUs running faster than 68EC020, this is a good idea. (Actually, it's a great idea no matter what, and I heartily support it! )

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.
Photon is offline  
Old 06 July 2024, 14:33   #4
Yulquen74
Registered User
 
Join Date: May 2013
Location: Kleppe / Norway
Posts: 273
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.
Yulquen74 is offline  
Old 06 July 2024, 15:24   #5
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,058
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.
Don_Adan is offline  
Old 06 July 2024, 15:25   #6
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,723
Quote:
Originally Posted by Yulquen74 View Post
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.
Very nice, greatly appreciated! I'm setting up network on ACA500Plus and ofc compatible drivers are included with X-Surf, but I tried to set it up generally beforehand to get some practice and those libs/components (e.g. AmiTCP4) I've tried so far have actually had a 68000 port.

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.
Photon 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
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

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 07:13.

Top

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