15 April 2023, 11:18 | #1 |
Registered User
Join Date: May 2011
Location: Italy
Posts: 214
|
Newbie query on assembling an intro on VASM
Hello,
Totally new to VASM assembly, so if my question is too simple or stupid please bear with me, because I am certainly doing something wonky I have been testing the https://github.com/mnemo70/paranoimia-vector-logo on the latest VASM with the Amiga VSCode toolchain https://github.com/prb28/vscode-amiga-assembly By the way, kudos to all the above people for the great work! Since the code has been Re-Sourced for Asm-One, the PNO source assemble and runs just fine on Asm-One v1.20 on the WB 1.3. I am using the v1.20 only because the intro runs on KS 1.3, I guess the Asm-One v1.48/1.49 would work too. Now the question. This is meant more to learn how this works on vasm rather than getting that specific intro working. When compiling the source on vasm, I get several "unsupported on CPU". No probs, I have added the following and it assembles fine. For simplicity, I list only one occurence per intruction. They all seem related to long-words. Code:
mc68020 bne.l .notzero mc68000 mc68020 bmi.l lbc00037c mc68000 mc68020 beq.l lbc0002d0 mc68000 mc68020 bpl.l lbc000468 mc68000 mc68020 ble.l reinit_starpos mc68000 mc68020 blt.l reinit_starpos mc68000 mc68020 bgt.l reinit_starpos mc68000 mc68000 cmpi.w #255,d5 mc68000 mc68020 bgt.l reinit_starpos mc68000 I know this is a bit newbie to ask, but any suggestions if it could be possible to get this linked fine? Thank you in advance if someone could help a little These are the VASM settings that I have tried. The VScode in ASM compatibility mode. Code:
"-linedebug", "-Fhunkexe", "-m68000", "-devpac Code:
"-nosym", "-kick1hunks" Code:
"-bamigahunk", "-Bstatic" Last edited by RoC; 15 April 2023 at 11:32. |
15 April 2023, 11:24 | #2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,097
|
32-bit relative branches (bcc.l, bsr.l, bra.l) require a 68020+ cpu. A500 is typically equipped with a 68000. Use jsr/jmp instead, or try to convert to 16-bit .w (destination must be within +/- 32KB).
|
15 April 2023, 11:31 | #3 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,391
|
What does it say if instead of :
Code:
mc68020 bne.l .notzero mc68000 Code:
bne .notzero As the "mc68020" directive says, long branches won't work on 68000 and so they crash on emulated A500. EDIT: a/b was faster |
15 April 2023, 11:35 | #4 |
Registered User
Join Date: May 2011
Location: Italy
Posts: 214
|
Hi a/b
Thanks, this is helpful So the first advise would be converting to a 16-bit range, I will make it a try. Hi Meynaf, I will test that too Last edited by RoC; 15 April 2023 at 11:37. Reason: Additional help |
15 April 2023, 13:40 | #5 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Assemble the source with ASM-One using the "optimise" option (i.e. use AO instead of just A), it should fix the long branches. Then save the source and it should assemble fine with VASM too.
|
15 April 2023, 15:14 | #6 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,583
|
Early 80s 68000 assemblers, like the infamous Seka, used
.sfor short branches and .lfor long branches. With short and long they meant 8-bit and 16-bit distances, as nothing else was possible on the 68000. Correct would be .bfor 8-bit and .wfor 16-bit branches, of course, as documented by Motorola. At least my 1989 edition of the M68k PRM doesn't know about short or long branches. The .scan still be found in many sources, but .lhas really become a problem since the introduction of the 68020, which was already quite a few years ago... So I'm surprised that ReSource generates such output. EDIT: And I'm equally surprised that AsmOne accepts that (like Seka!). Or does it automatically treat .l as .w in 68000 mode? Last edited by phx; 15 April 2023 at 15:25. Reason: AsmOne |
15 April 2023, 15:37 | #7 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
I do not think this is the original ReSource output, the source has probably been modified.
Long branches will be silently "converted" to the correct .w version. When using AO (A.ssemble O.ptimise(d)), the branch will be converted to .w ("Branch forced to word size") and the source will be changed accordingly. |
15 April 2023, 17:18 | #8 | |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,134
|
Quote:
|
|
15 April 2023, 19:21 | #9 |
Registered User
Join Date: May 2011
Location: Italy
Posts: 214
|
Gents,
Many thanks for the many good ideas I am going to explore all the different routes, because the scope is to learn. Will let you know |
15 April 2023, 19:42 | #10 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
The intro runs on 68000, thus I do not think it is original ReSource output.
Quote:
|
|
15 April 2023, 20:41 | #11 |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,134
|
When I was active, then i was used Asmone 1.20. Asmone 1.20 has no problem for assembling .l branches as .w branches. Devpac has no problems too, but many warnings was displayed. In general I prefer code in Old Syntax look (with New Syntax for branches) , because is shortest (less signs), fastest for assembling and its easiest to understand for me. Then later i dissasemble players with Resource 5 in Old Syntax mode, load resourced source in CED, and autoreplace .l branches with .b branches (Devpac warnings was used which branches must be replaced)
|
30 May 2024, 21:49 | #12 |
MTN/SPT
Join Date: Sep 2019
Location: Germany
Age: 54
Posts: 63
|
Oops, sorry for the mess. The mentioned repo with the Paranoimia intro is mine and I resourced it for fun. The version I have on my computer does not have the Bxx.L instructions, I haven't committed this to GitHub, though.
I also have a modernized version of the source that assembles in Devpac, but I'm not sure if it was fully finished. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Assembling Photon's tutorials using vasm | guy lateur | Coders. Asm / Hardware | 9 | 20 June 2018 13:08 |
VASM wrong assembling? | deadwood | Coders. Asm / Hardware | 32 | 01 January 2015 23:25 |
Assembling Gravity Force 2 source code | absence | Coders. General | 5 | 13 May 2012 11:44 |
[REQ:ASM] Assembling and running | jman | Coders. Tutorials | 9 | 07 May 2011 18:39 |
Devpac and assembling for absolute addresses | h0ffman | Coders. General | 10 | 21 March 2011 19:12 |
|
|