English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 22 March 2021, 21:13   #1
oRBIT
Zone Friend
 
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 48
Posts: 339
Hints for organizing asm-code?

I'm poking through a very old and big (17,000 rows) asm-project of mine. I want to split up different parts to different files to "include". I'm pretty sure none of the included files will compile on it's own (since they most likely needs variables/stuff from other parts).
Not entirely sure how I should do this, but I'm after some hints and tips here. How are you guys organizing your "projects"?
I'm using Asm-One btw if that matters.

Thanks in advance
oRBIT is offline  
Old 22 March 2021, 22:58   #2
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
I tend to split my files by functionality and if this still leads to files that are too big, I split up further. So for example, I might have a graphics.asm but if that gets too big, I might have a blitter.asm and a sprites.asm.

Structure definitions, constants, macros etc I tend to put in .i files (along with external references).
roondar is online now  
Old 24 March 2021, 07:17   #3
Geijer
Oldtimer
 
Geijer's Avatar
 
Join Date: Nov 2010
Location: VXO / Sweden
Posts: 153
Quote:
Originally Posted by oRBIT View Post
I'm poking through a very old and big (17,000 rows) asm-project of mine. I want to split up different parts to different files to "include". I'm pretty sure none of the included files will compile on it's own (since they most likely needs variables/stuff from other parts).
Not entirely sure how I should do this, but I'm after some hints and tips here. How are you guys organizing your "projects"?
I'm using Asm-One btw if that matters.

Thanks in advance
If you use a linker you can use XDEF/XREF to access variables/stuff in other files but that requires a linker and Asm-One doesn't have one built in (I have moved to Makefiles and vasm/vlink for larger projects).

I usally break out parts of the code that I feel is stabel and I'm finished with. If you use "include" there is no problem with accessing stuff in other files, just keep the include statement in the same place as the code was that is to be included.

Data I almost always keep in separate files in a "assets" subdir.

Quote:
Originally Posted by roondar View Post
I tend to split my files by functionality and if this still leads to files that are too big, I split up further. So for example, I might have a graphics.asm but if that gets too big, I might have a blitter.asm and a sprites.asm.

Structure definitions, constants, macros etc I tend to put in .i files (along with external references).
Do you use "include" or a linker to "join" the code?
Geijer is offline  
Old 24 March 2021, 11:23   #4
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
Quote:
Originally Posted by Geijer View Post
Do you use "include" or a linker to "join" the code?
Yeah, I do use a linker (and makefiles).
My weapons of choice are vasm, vlink and the version of make made by the same author.
roondar is online now  
Old 12 April 2021, 23:41   #5
VladR
Registered User
 
Join Date: Dec 2019
Location: North Dakota
Posts: 741
I simply use Notepad++ and use block folding feature (open/close). The ASM file is preprocessed by my own parser before I feed it into vasm/vlink.


This way, a 10,000-line file can be viewed fully folded on a single screen and I only zoom [on demand] into parts that require my attention. Definitely beats switching between 50 files (been there, done that, thanks but no thanks )
VladR 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
Organizing .asm projects juice Coders. Asm / Hardware 13 28 July 2020 20:11
Asm-One 1.02 original source code kamelito request.Apps 4 20 November 2017 12:15
Can someone explain this Suntronic ASM code? 1988 Coders. Asm / Hardware 1 31 May 2015 17:32
Problems with a little ASM code VoltureX Coders. General 7 12 December 2011 13:10
Lots of ASM code Ray Norrish Coders. General 9 22 February 2006 02:20

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 00:33.

Top

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