26 January 2021, 10:43 | #1 |
Registered User
Join Date: May 2017
Location: AmigaLand
Posts: 459
|
compil error VASM
Hi,
May be someone could help. I've got a strange error when trying to assemble using Vasm : error 31 in line 41 of "part6.s": expression must be constant >bufpokt: blk.w HF,0 ; buffer scrolltext HF is defined below the "blk.w". H=12. Before the bufpokt label I have an "even" directive. After this block I have also valid instructions. I tried to use other constants and same error. Very strange. Really no idea what's going on. Edit : If I replace blk.w HF,0 by dc.b HF it works. If I set HF=512 and let the dc.b, then no errors also. 512 is not a byte it should display an error or at least a warning. May be vasm set the complementary to 255 ? Last edited by LeCaravage; 26 January 2021 at 10:50. |
26 January 2021, 10:52 | #2 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
As far as I understand it, this is because VASM doesn't know symbols unless they're defined prior to the actual use of them. There are two solutions for this that I've used (there may be more, there may be better ones):
1) define HF before the line that uses it. Code:
HF EQU <something> ... etc ... bufpokt: blk.w HF,0 ; buffer scrolltext Code:
Include file: XREF HF Source file: include file_that_has_hf_xref.i ... etc ... bufpokt: blk.w HF,0 ; buffer scrolltext Last edited by roondar; 26 January 2021 at 10:54. Reason: Spelling / examples |
26 January 2021, 10:54 | #3 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
|
I think blk.w / ds.w needs constant values. XREF isn't going to cut it. You need something like HF = 300 (equate/define)
|
26 January 2021, 10:56 | #4 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
|
26 January 2021, 10:58 | #5 |
Registered User
Join Date: May 2017
Location: AmigaLand
Posts: 459
|
Roondar, you're the man !
If moved the Hf = 12 within the include file (the definition was at first in top of main.s) and it fixed the pb. I guess the Xref does also the trick. AFAIK Seka doesn't need this. Thanks pal, |
26 January 2021, 11:05 | #6 |
Registered User
Join Date: May 2017
Location: AmigaLand
Posts: 459
|
@jotd and Roondar : I'm dumb in english, I used below instead of above in first post ^^
|
26 January 2021, 12:08 | #7 | |||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Otherwise there should be no problem, even when defining HF below the BLK-directive: Code:
frank@nerthus cat blkexpr.s blk.w HF,0 HF=12 frank@nerthus vasmm68k_mot blkexpr.s vasm 1.8i (c) in 2002-2020 Volker Barthelmann vasm M68k/CPU32/ColdFire cpu backend 2.3m (c) 2002-2020 Frank Wille vasm motorola syntax module 3.14a (c) 2002-2020 Frank Wille vasm test output module 1.0 (c) 2002 Volker Barthelmann CODE(acrx1): 24 bytes Quote:
Quote:
Code:
frank@nerthus cat byterange.s dc.b HF HF=512 frank@nerthus vasmm68k_mot -quiet byterange.s error 2040 in line 1 of "byterange.s": data out of range > dc.b HF |
|||
26 January 2021, 14:10 | #8 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
I don't know what I was thinking there... You're of course fully correct.
Next time I'll be sure to check first and then write Anyway, I do believe I know why I thought this: I seem to recall that you do need to define macro's before use and I guess that made me make a mistake. Well that and trying to quickly answer a post while I really ought to be doing other things |
26 January 2021, 15:05 | #9 |
Registered User
Join Date: May 2017
Location: AmigaLand
Posts: 459
|
And to summarize, I entered this thread convinced of vasm's fault and I go out I was totally wrong ^^
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VASM: strange behaviour, quits with error 8 | buzzybee | Coders. Asm / Hardware | 2 | 07 August 2020 23:06 |
error compiling vasm on windows | Ami030 | Coders. Asm / Hardware | 3 | 28 December 2019 16:07 |
vasm/mot: include failed error message | guy lateur | Coders. Asm / Hardware | 6 | 23 December 2018 20:29 |
VASM fatal error.. | jimmy2x2x | Coders. Asm / Hardware | 2 | 21 November 2014 10:27 |
Dragons Compil #30 | netraider | request.Demos | 1 | 09 November 2012 10:07 |
|
|