16 April 2020, 17:11 | #1 |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 19
|
ASM-One and XREFs
Hi,
the ASM-One manual states: "If you have used XREF or XDEF in your source, it prevents an object file from being saved [..]". I suppose, this is the reason why I can't write an object after successfully assembling code. A little context: I am reading a book from '88 about assembly language programming for the MC68000 processor. The book provides a "shell" program for simple I/O (putc/getc, etc.). Since the book is very old and I don't have any sources, I typed the program into ASM-One. So far so good. My problem now is, that I can't write an object file. I would need that object file because I have to link it with amiga.lib. After some further reasearch, I found the statement above in the ASM-One Manual. As I understand it, an XREF is like an "external" directive in C, is that correct? Are there any other reasons why ASM-One would fail to write an object? If anybody is interested, this is the code: https://pastebin.com/raw/KGvRbeci Any help is appreciated! Thanks Last edited by desm0; 16 April 2020 at 17:37. |
16 April 2020, 18:04 | #2 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Looking at the ASM-One manual, it says that code containing XREFs or XDEFs cannot be directly executed. Is there a different compile only command that will create just an object file for you to link separately?
Edit: Bottom of page 50, WL rather than WO. Quote:
|
|
16 April 2020, 18:13 | #3 | |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 19
|
Quote:
Ok, WL might be exactly what I need. I will give it a try, thank you! *edit: Just tried it. Unfortunately, same result with WL: ** No Object |
|
16 April 2020, 18:31 | #4 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
WL should work fine, if not either your ASM-One version is buggy or you're doing it wrong.
|
16 April 2020, 18:32 | #5 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
|
|
16 April 2020, 18:48 | #6 |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 19
|
|
16 April 2020, 18:49 | #7 |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 19
|
|
16 April 2020, 18:52 | #8 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
I have tried with V1.48 and WL worked fine with your source. So I guess you're doing something wrong. Did you maybe forget to assemble before using WL?
|
16 April 2020, 19:02 | #9 | |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 19
|
Quote:
I am an idiot. After typing WO xxx a dozen times, I forgot to assemble before WL. It works fine when done correctly Thanks! One other question: What screen resolution are you using? My fonts are still quite ugly compared to yours. My setup: picasso96, UAEgfx, 1024x768, Winuae. |
|
16 April 2020, 19:26 | #10 | ||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Quote:
|
||
16 April 2020, 21:37 | #11 | |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 19
|
Quote:
Interesting. Even with the smaller resolution my fonts don't look so smooth.. But I can live with that Unfortunately I ran into another problem, maybe someone had this before: I am linking 'amiga.lib' (downloaded it from this repo: https://github.com/kusma/amiga-dev/t...8k-amigaos/lib). The last time I did this, I was about 25ys younger, so my memory is a little hazy but I think that I linked this way: blink file.o library path:to/amiga.lib to file.exe This completely locks up winuae. Can't even move the mouse pointer anymore. It doesnt crash however. Do I have to link against a specific version of 'amiga.lib'? I am using blink v6.7 from Aminet. Thanks! PS: Your location says Berlin; Greets from Charlottenburg! *edit winuaelog.txt says: 42-254 [3244 224-114]: Your Amiga program just did something terribly stupid 61600043 PC=00425CD8 Last edited by desm0; 16 April 2020 at 21:58. |
|
17 April 2020, 10:20 | #12 | ||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Quote:
|
||
17 April 2020, 10:46 | #13 | |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 19
|
Quote:
You were correct again I had JIT enabled the day before. Turning it off doesn't fix the problem but at least Winuae does not lock up anymore. Blink crashes. I will do some more tests with a simpler example. Thanks! |
|
17 April 2020, 13:08 | #14 |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 19
|
A general question about linking:
Does my main.s file has to contain a certain label or branch/jump in order to be linked with amiga.lib? I ripped out everything from my original .s file. Now my testcase simply contains: Code:
move.l #0,d0 move.l #1,d1 Code:
blink :out.o to :out.exe library :lib/amiga.lib This however results in a guru error (8000 000B). I have tried a different amiga.lib version which results in a different error (8000 0004, which denotes an illegal instruction if I am remembering correctly). Which version of amiga.lib should I use on a WB3.1, a1200 aga setup? Sorry if I am missing something obvious, it has been a long time |
21 April 2020, 10:46 | #15 |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Don't you need something like this at the end of your program?
Code:
moveq #0,d0 ;return 0 to the system rts |
23 April 2020, 22:23 | #16 | |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 19
|
Quote:
I didn't post the return/sub instruction but it was present in the actual code. I still have no why linking isn't possible. It is working when I don't include the XREFs and hardcode the offsets. |
|
24 April 2020, 00:38 | #17 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
You don't have to return 0 in d0.
Amigashell interprets 0 in d0 as "all went well". Shows cmd failed with code 42 (that's from the top of my head, but something close to that) if you return with 42 in d0. As far as I know, you can trash all registers with your program. Well, not a7 which is stack pointer. Last edited by alkis; 24 April 2020 at 00:46. Reason: sp clarification |
24 April 2020, 00:44 | #18 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
can you try linking with this one instead?
https://github.com/kusma/amiga-dev/t...dk/linker_libs That's from the official NDK |
25 April 2020, 17:07 | #19 | |
Registered User
Join Date: Feb 2020
Location: Germany
Posts: 19
|
Quote:
I will give it a try, thanks! |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tool to convert asm to gnu asm (gas) | Asman | Coders. Asm / Hardware | 13 | 30 December 2020 11:57 |
Another ASM newbie... | DanielAllsopp | Coders. Asm / Hardware | 28 | 23 August 2019 17:09 |
ClassicWB and ASM-One V1.48 | Black.Jack | support.WinUAE | 5 | 04 January 2016 17:49 |
Datastructures in ASM | lole | Coders. Asm / Hardware | 8 | 13 October 2012 12:38 |
ASM Uni Course | BippyM | Coders. Tutorials | 27 | 18 September 2008 10:37 |
|
|