English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 11 May 2020, 10:27   #1
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 76
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
thyslo is offline  
Old 11 May 2020, 10:37   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 451
Longer binaries without any benefit.
Thomas Richter is offline  
Old 11 May 2020, 11:32   #3
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 233
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.
Antiriad_UK is offline  
Old 11 May 2020, 11:43   #4
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 76
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!
thyslo is offline  
Old 11 May 2020, 11:48   #5
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 1,958
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.
roondar is offline  
Old 11 May 2020, 11:53   #6
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 233
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.
Antiriad_UK is offline  
Old 12 May 2020, 01:33   #7
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,661
Quote:
Originally Posted by thyslo View Post
So I'll try and see if my ancient O.M.A. assemblers linker is able to merge the data sections
Any linker should automatically merge sections with the same type and name. Otherwise I would regard that as a bug.

Although for AmigaDOS hunks there is an exception: sections without a name or named __NOMERGE are never merged (source: The Amiga Guru Book).
phx 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
[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

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 12:06.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07487 seconds with 15 queries