English Amiga Board


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

 
 
Thread Tools
Old 07 December 2014, 18:06   #1
nandius_c
Fernando Cabrera

 
Join Date: Oct 2013
Location: Spain
Posts: 100
Linker to use with AsmOne (68000)

Hi everyone! I've spent some time today trying to find the easiest way to link more than one file using AsmOne (for the 68000) but I wasn't able to find anything. I have a source file which uses xdef for some routines and another source where I use xref to be able to call those routines.

As far as I know I can't do that with AsmOne, can I? It would be great if someone could just point in the right direction about the easiest way to do this, having into account that, as I said before, I'm programming only for the 68000.

Thanks in advance!

Last edited by nandius_c; 10 December 2014 at 16:10.
nandius_c is offline  
Old 07 December 2014, 20:25   #2
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,030
"wl" writes a linkable object file, doesn't it?
Then proceed with the linker of your choice.
phx is offline  
Old 08 December 2014, 01:00   #3
nandius_c
Fernando Cabrera

 
Join Date: Oct 2013
Location: Spain
Posts: 100
Quote:
Originally Posted by phx View Post
"wl" writes a linkable object file, doesn't it?
Then proceed with the linker of your choice.
Yes, I knew about the 'wl' command . What I need now is an easy-to-use linker. I found this: http://www.pouet.net/prod.php?which=58703 some time ago but didn't try the included version of vlink compiled for Windows. I will do that right now!

Thanks for your answer .
nandius_c is offline  
Old 09 December 2014, 01:05   #4
DrCinicus
Registered User

 
Join Date: Oct 2008
Location: Assemini/Italy
Age: 49
Posts: 23
To call the linker inside AsmPro (should work also on AsmOne), I add these lines at the start of the source:

AUTO wl rad:main.o\
AUTO y c:blink rad:main.o LIB path:somelib.lib\

When you assemble, and there are 'No errors', the first line save the Linkable file, while the second line execute the linker to create the executable file.
In your work you should assemble and write-linkable one of the file, and put a similar command in the other:

AUTO wl rad:main.o\
AUTO y c:blink rad:main.o rad:file1.o TO rad:myexe\

Bye
Fabio

Last edited by DrCinicus; 09 December 2014 at 10:31. Reason: Forgot '\' in the last line,
DrCinicus is offline  
Old 09 December 2014, 02:28   #5
a4k-oerx
Registered User
 
Join Date: Oct 2008
Location: EU
Posts: 145
OT: "AUTO" was one of the many features which made me buy AsmOne 1.02 as one of the few investments in Amiga software at the time it was released by Rune Gram-Madsen. Was far superior to Seka. Even "hacked" a later version, so the editor would work with DoublePAL when I got the A4000. Best tool ever in my Amiga life...
a4k-oerx is offline  
Old 09 December 2014, 13:00   #6
nandius_c
Fernando Cabrera

 
Join Date: Oct 2013
Location: Spain
Posts: 100
Quote:
Originally Posted by DrCinicus View Post
To call the linker inside AsmPro (should work also on AsmOne), I add these lines at the start of the source:

AUTO wl rad:main.o\
AUTO y c:blink rad:main.o LIB path:somelib.lib\

When you assemble, and there are 'No errors', the first line save the Linkable file, while the second line execute the linker to create the executable file.
In your work you should assemble and write-linkable one of the file, and put a similar command in the other:

AUTO wl rad:main.o\
AUTO y c:blink rad:main.o rad:file1.o TO rad:myexe\

Bye
Fabio
Very useful information, thank you. I've downloaded BLink and I've been doing some tests. I'm not using the AUTO command yet, I'm doing something like this from a shell window, and it's working fine:

blink main.o LIBRARY lib.o TO myexe

First, I tried with something like this:

blink main.o lib.o TO myexe

but it didn't work. Guess it was necessary to specify lib.o as a library.

I understand this is all basic stuff but it's new to me, so... thanks again for your help!
nandius_c is offline  
Old 09 December 2014, 16:36   #7
nandius_c
Fernando Cabrera

 
Join Date: Oct 2013
Location: Spain
Posts: 100
I've being doing some tests with AUTO in AsmOne and I haven't been able to make it work completely. These are the first lines of my source file main.s:

AUTO wl main.o\
AUTO y BLink main.o LIBRARY lib.o TO myExe\

BLink, main.o and lib.o are in the current directory. When I assemble the source from AsmOne, the first line is executed and generates the main.o file but the second line always produces an "End of File" message and doesn't generate the myExe file. As I said before, I can execute that BLink command from a Shell window and it works.

Any ideas?
nandius_c is offline  
Old 09 December 2014, 17:51   #8
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,030
Quote:
Originally Posted by nandius_c View Post
blink main.o LIBRARY lib.o TO myexe

First, I tried with something like this:

blink main.o lib.o TO myexe

but it didn't work. Guess it was necessary to specify lib.o as a library.
Is lib.o a library (i.e. several object files coalesced) or a single object file? In the last case it should work to omit the LIBRARY keyword. Otherwise there is something wrong.
phx is offline  
Old 10 December 2014, 11:00   #9
nandius_c
Fernando Cabrera

 
Join Date: Oct 2013
Location: Spain
Posts: 100
Quote:
Originally Posted by phx View Post
Is lib.o a library (i.e. several object files coalesced) or a single object file? In the last case it should work to omit the LIBRARY keyword. Otherwise there is something wrong.
lib.o is just the result of doing 'wl lib.s' from AsmOne, that is, a single object file. Is it OK using 'wl' if I will use the linker with the file or should I use 'wo'? I'm not sure about what's the difference between those. Anyway, I couldn't make it work without LIBRARY.

Another problem I'm having is with the copperlist. I have a single file, copper.s (attached), which just sets a new copperlist and waits for the left mouse button. If I generate the object file with 'wo copper.o', I can run the exe file from a shell window and it does changes the copperlist and works OK (background color changes to black). BUT, If I do 'wl copper.l' in AsmOne and after that I generate the exe file with 'blink copper.l TO copper', it doesn't work (background color doesn't change). With the WinUAE debugger I see that COP1LC is pointing to an address which is not that of my copperlist. I get the same result from AsmOne if I change 'section data,DATA_C' to 'section data,DATA_F'...
Attached Files
File Type: s copper.s (4.2 KB, 105 views)
nandius_c is offline  
Old 10 December 2014, 11:47   #10
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,030
Quote:
Originally Posted by nandius_c View Post
lib.o is just the result of doing 'wl lib.s' from AsmOne, that is, a single object file. Is it OK using 'wl' if I will use the linker with the file or should I use 'wo'? I'm not sure about what's the difference between those.
'wo' writes a directly executable file.
'wl' writes a linkable object file (not executable until linked).

Quote:
Anyway, I couldn't make it work without LIBRARY.
Maybe a bug. Attach the example object files or send them to me by private mail and I could analyze the problem.

Quote:
BUT, If I do 'wl copper.l' in AsmOne and after that I generate the exe file with 'blink copper.l TO copper', it doesn't work (background color doesn't change). With the WinUAE debugger I see that COP1LC is pointing to an address which is not that of my copperlist. I get the same result from AsmOne if I change 'section data,DATA_C' to 'section data,DATA_F'...
I tried that with AsmOne 1.49 and can reproduce the problem. A bug in AsmOne. 'wo' seems ok and provides the memory attributes in the executable, but 'wl' does not. Your DATA_C (and DATA_F) is ignored in the object file. That makes AsmOne nearly useless for linking.
phx is offline  
Old 10 December 2014, 12:53   #11
nandius_c
Fernando Cabrera

 
Join Date: Oct 2013
Location: Spain
Posts: 100
Quote:
Originally Posted by phx View Post
'wo' writes a directly executable file.
'wl' writes a linkable object file (not executable until linked).

Maybe a bug. Attach the example object files or send them to me by private mail and I could analyze the problem.

I tried that with AsmOne 1.49 and can reproduce the problem. A bug in AsmOne. 'wo' seems ok and provides the memory attributes in the executable, but 'wl' does not. Your DATA_C (and DATA_F) is ignored in the object file. That makes AsmOne nearly useless for linking.
I'm really surprised about your answer... I like AsmOne, but I've been thinking of trying another assembler and, if you're right, now I have another GOOD reason to do it. I will try with AsmPro tonight and let you know about the results (I guess it will work as DrCinicus already mentioned using the 'wl' command from AsmPro). Thank you so much!

EDIT: I have found this link relating to AsmOne v1.48 with info about errors dealing with sections and the 'wl' command... http://www.theflamearrows.info/documents/asmfuture.html It doesn't seem to be the same problem I'm having, but if v1.47 had such a bug, imagine v1.20 (the one I'm using)...

Last edited by nandius_c; 10 December 2014 at 13:53.
nandius_c 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
Strange AsmOne operator phx Coders. Asm / Hardware 23 19 March 2015 00:13
AsmOne: Undefined symbol copse Coders. Asm / Hardware 2 02 April 2012 02:41
AsmOne doesn't like my accelerator... Photon Coders. General 6 04 February 2011 00:37
AsmOne even directive...? pmc Coders. General 30 04 December 2009 10:33
ASMOne: Sectors and Tracks Vortex Coders. General 19 03 December 2009 09:31

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


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.12517 seconds with 14 queries