English Amiga Board


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

 
 
Thread Tools
Old 09 March 2016, 07:44   #1
Knocker
Registered User
 
Join Date: Jan 2016
Location: Santa Cruz/US
Posts: 48
Link external modules in Devpac

In order to speed up assemble I'd like to pre-assemble a code module (Protracker player), but I can't get it to work.

Let's say I have an external module, ExternalModule.s, with a function like this:

Code:
	xdef ExternalFunction
ExternalFunction:
	moveq #5,d0
	rts
I want to call the function from my main, Main.s, module:

Code:
	xref ExternalFunction
Main:
	moveq #1,d0
	jsr ExternalFunction
	moveq #5,d0
This is what I've tried:

Open ExternalModule.s in Devpac 3.
In Settings->Assembler->Control change Format to Linkable and change output to ExternalModule.o with path the same as the .s files.
In Settings, check Assemble To Disk
Assemble (this creates ExternalModule.o)
Open Main.s
Change the two Settings back to their defaults
Assemble => Error undefined symbol at line 4 in file Main.s

Seems like I need to tell the assember/linker about ExternalModule.o somehow. Haven't tried linking them together from CLI using Blink, ideally I'd like to do it directly from the Devpac editor, by simply selecting Assemble.

Any ideas?
Knocker is offline  
Old 09 March 2016, 11:04   #2
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Knocker View Post
Open Main.s
Change the two Settings back to their defaults
Assemble => Error undefined symbol at line 4 in file Main.s
Never really worked with the Devpac GUI, but you have to make sure that both are linkable object files, so don't reset the two settings here.

Quote:
Seems like I need to tell the assember/linker about ExternalModule.o somehow.
You have to tell the linker. The assembler only needs to know which symbol is externally defined (XREF) or visible for the linker (XDEF).

Quote:
Haven't tried linking them together from CLI using Blink, ideally I'd like to do it directly from the Devpac editor, by simply selecting Assemble.
I didn't know that the Devpac GUI contains a linker.
phx is offline  
Old 10 March 2016, 06:13   #3
Knocker
Registered User
 
Join Date: Jan 2016
Location: Santa Cruz/US
Posts: 48
Thanks phx. I guess I should state that I'm just assuming this is possible to do - it may not be. It would kind of suck, at least by modern standards , to have to leave the IDE and go to CLI to build/run programs consisting of multiple modules. I just want to do my regular Amiga-a to assemble and Amiga-x to run!

Quote:
I didn't know that the Devpac GUI contains a linker.
Well, the manual seems to imply that it comes with Blink, but I can't find it. In fact I can't find it anywhere, maybe I should try your PhxLnk432? But again, having a separate step to link then run kind of defeats the purpose of building multiple modules for me.
Knocker is offline  
Old 10 March 2016, 10:54   #4
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
As your goal seems to speed up the assembly, perhaps another assembler could do the job - as devpac is clearly not among the fastest.
However if you really need an IDE then you're a little bit locked i'm afraid...
meynaf is offline  
Old 11 March 2016, 15:33   #5
modrobert
old bearded fool
 
modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 56
Posts: 775
Quote:
Originally Posted by Knocker View Post
Well, the manual seems to imply that it comes with Blink, but I can't find it. In fact I can't find it anywhere, maybe I should try your PhxLnk432? But again, having a separate step to link then run kind of defeats the purpose of building multiple modules for me.
You can find Blink here: http://aminet.net/package/dev/misc/blink67

After searching through Amiga TOSEC and other places, I can't find 'Blink' in the Devpac releases either, looks like two floppies are missing.

This is from the Devpac 3 manual.

Quote:
Devpac 3 Disk Contents

Devpac Amiga is supplied on four 3.5" disks; the first set of two is intended for use under version 1.3 of the operating system whilst the second is for use with Release 2 to 3.1.
The files from the Devpac drawer mentioned in the manual which are missing as follows; BLink, FD2LVO, SRSplit.

Anyway, I can recommend vlink if you rather use a linker which is up to date.
modrobert is offline  
Old 14 March 2016, 02:08   #6
Knocker
Registered User
 
Join Date: Jan 2016
Location: Santa Cruz/US
Posts: 48
Thanks modrobert. I got it configured so the Execute option (Amiga-E) in Devpac runs a two line script that invokes Blink and then runs the program. Not sure if this is faster than just having one big source file though, since the linking is pretty slow. Btw, took forever to get Blink to work - my code had a "opt c-" line in it that somehow screwed up the case of xdefs so they couldn't be found...
Knocker is offline  
Old 23 March 2016, 15:22   #7
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Opt c- in Devpac turns off case sensitivity, likewise Opt c+ turns it on.


Personally, I always have case sensitivity on in my code.
Lonewolf10 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
EDU - External Disk Unit | External gotek for Commodore Amiga with LCD & Sound arananet Amiga scene 7 02 April 2016 21:06
Devpac 3 BippyM MarketPlace 11 19 July 2012 18:21
devpac 3.5 zeGouky request.Apps 28 26 October 2011 20:36
Devpac 3.x Frank Black request.Apps 13 27 August 2006 00:24

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 11:17.

Top

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