11 May 2020, 10:27 | #1 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 189
|
Many data sections - bad practise?
From time to time I'm experimenting with some asm coding on the Amiga.
My latest effort is to group code by its functions and move it to separate asm files. I'm exporting these functions with XDEF and reference them from main.asm with XREF. Now it is quite handy to have separate data sections in some of the .asm files e.g. to create a buffer for reading lines etc. But are there disadvantages when you have maybe 10 data sections instead of just one in an asm project? Last edited by thyslo; 11 May 2020 at 12:00. Reason: spelling |
11 May 2020, 10:37 | #2 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,216
|
Longer binaries without any benefit.
|
11 May 2020, 11:32 | #3 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
If you give them all the same section name (at least with vasm) the linker will merge them together in the same section anyway so won't make the binary any worse. Using XDEF with smaller components is definitely a good thing (tm) as long as you are comfortable with having a batch/makefile to assemble and link everything you need.
|
11 May 2020, 11:43 | #4 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 189
|
So I'll try and see if my ancient O.M.A. assemblers linker is able to merge the data sections, that would be great. Thanks for this hint!
|
11 May 2020, 11:48 | #5 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,411
|
IIRC there's also a flag for VASM/VLINK which, when set, will make the linker try to merge all sections of the same type together - regardless of name.
|
11 May 2020, 11:53 | #6 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
Indeed.
And remember sometimes more small sections is better than one big section if you are trying to squeeze everything into fragmented ram. On my last intro I put all the shared/big chip mem stuff (things I needed to be contiguous) into one section that fitted into your average WB 1.3/2.x/3.x workbench boot up in most configs I checked, and then put any other chip mem requirements into smaller sections. Last edited by Antiriad_UK; 11 May 2020 at 11:59. |
12 May 2020, 01:33 | #7 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Although for AmigaDOS hunks there is an exception: sections without a name or named __NOMERGE are never merged (source: The Amiga Guru Book). |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Found: Monaco GP] Arcade - top down racer - with tunnel sections | Zak | Looking for a game name ? | 11 | 02 February 2019 16:45 |
support.hardware - sections? | BMD | project.EAB | 9 | 29 September 2018 22:25 |
Last Ninja 1-3 Amiga & C64 jumping sections video | laffer | Retrogaming General Discussion | 4 | 14 May 2008 18:47 |
WHDLoad games sections | plasmatron | support.Games | 2 | 27 May 2003 22:12 |
Annoying sections in good games | alkis21 | Nostalgia & memories | 41 | 27 September 2002 14:11 |
|
|