English Amiga Board


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

 
 
Thread Tools
Old 30 March 2019, 19:00   #1
oRBIT
Zone Friend
 
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 44
Posts: 260
Linking a demo/intro?

Back in the days when I coded ("tried" perhaps ) demos with my friends it was always a mess linking eachothers sourcecode to one file, there was duplicate labels and the result was always messy and often introduced bugs. Well, it was many years ago.
But I'm curious, what is a good workflow for this kind of stuff?
oRBIT is offline  
Old 30 March 2019, 19:15   #2
DanScott
Lemon. / Core Design

DanScott's Avatar
 
Join Date: Mar 2016
Location: Sunny Bournemouth, UK
Posts: 437
Some kind of source control system
DanScott is offline  
Old 30 March 2019, 20:55   #3
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,451
Quote:
Originally Posted by oRBIT View Post
it was always a mess linking eachothers sourcecode to one file, there was duplicate labels and the result was always messy and often introduced bugs.
Assemble each source code into an object file which exports only those symbols which are referenced by other modules. No more problems with duplicate symbols. Use a linker.
phx is offline  
Old 30 March 2019, 20:56   #4
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,238
When having to deal with sources from lots of different coders it always helps to extend the labels with a unique extension (such as the coders initials for example) so there won't be any duplicate label names. Quite easy to do in any text editor or assembler (ASM-One has "EL" command for this). Always worked pretty well for me.
StingRay is offline  
Old 30 March 2019, 21:14   #5
oRBIT
Zone Friend
 
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 44
Posts: 260
@phx: Sounds interesting, "object file"? Can you explain a little bit more? Back in the days I used some tool that linked exe's together (Called "ExeLink" I think), but you're talking about something else?
oRBIT is offline  
Old 31 March 2019, 12:38   #6
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,451
Linking executables is possible, but you are often missing symbol information and you never have any unresolved references in them.

Object files are the default output of all compilers and most assemblers. They include a complete list of symbol definitions, unresolved symbol references and relocations. So you can make an object file from
Code:
        xref    myfunc

        bsr     myfunc
        rts
...while the myfunc routine is unknown and defined in another source text, which you assemble as a second object file (do "xdef myfunc" there). You can assemble both individually, let's say into obj1.o and obj2.o, and then link both together into the final executable: "link -o myexe obj1.o obj2.o". The linker only sees "myfunc". All other symbols have local scope regarding the source text they are defined in.

Another advantage, especially if you are using Makefiles, is, that you only have to assemble the source which you just changed, and not the whole project. Then just relink all objects.

As far as I remember AsmOne/AsmPro can generate object files with the "WL" (write linkable file) command. Devpac has an option in its UI, or use the directive "OPT L+" to enforce object file output. For most other assemblers, especially command line based ones, it is the default output format.

For linking you can take any AmigaDos linker: alink, blink, slink, phxlnk, vlink, ...
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
Thoughts about intro/demo-engines? AGS Coders. Asm / Hardware 5 18 March 2015 04:23
Argentinian Amiga demo/intro Gavilan Amiga scene 16 15 November 2008 17:30
Old (80s) Triangle Intro/Demo? Dunny request.Demos 28 09 July 2007 18:26
S.A.E. Spectrum Intro/Demo Blip request.Demos 13 25 August 2006 11:43
phenomena intro/demo Darkseid request.Demos 0 04 August 2002 02:43

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:23.


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