English Amiga Board


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

 
 
Thread Tools
Old 06 January 2020, 15:54   #1
VladR
Registered User
 
Join Date: Dec 2019
Location: North Dakota
Posts: 741
vasm: Empty Macro issue

I'm porting a lot of code compiled by smac (I believe that's the madmac syntax originally) and I'm using these two macros for the folding of blocks inside Notepad++, which doesn't work in vasm:

Code:
.macro FoldStart
.endm
.macro FoldEnd
.endm
And this is how it's used in the source:
Code:
FoldStart ; wait_for_gpu_to_finish
wait_for_gpu_to_finish:
 .wait_gpu:
  cmp.l #DSP_DONE, gpuState
 bne .wait_gpu
 rts
FoldEnd
This allows the code sections to be neatly folded (into a single line showing only "FoldStart ; wait_for_gpu_to_finish") and opened up only when needed, which is a great way how to organize hundred thousands lines of code (without having to switch between lots of files).


This is the Windows vasm build:
Code:
vasm 1.8d (c) in 2002-2018 Volker Barthelmann
vasm M68k/CPU32/ColdFire cpu backend 2.3b (c) 2002-2017 Frank Wille
vasm motorola syntax module 3.11c (c) 2002-2018 Frank Wille
vasm hunk format output module 2.9b (c) 2002-2017 Frank Wille
And this is the full command line:
Code:
vasm -m68020 -Fhunkexe -o gt.exe  gt.asm
I can get only ONE pair of FoldStart/FoldEnd compiled. The second barfs out this:
Code:
 
error 75 in line 73 of "gt.asm": label <FoldStart> redefined
>FoldStart
error 75 in line 82 of "gt.asm": label <FoldEnd> redefined
>FoldEnd
So, it appears it actually creates a label ? From looking into the MOT syntax it appears it is, indeed, possible to define the label without using the ":".


This is how it's currently defined in code
Code:
 
FoldStart macro
    
    endm
FoldEnd macro
  
  endm
- I tried temporarily putting a NOP inside to make sure it's not the empty thing that makes vasm barf (not that I would want to have NOP few thousands time in a code), but that didn't help.
- Flipping "FoldStart macro" into "macro FoldStart" results in error :"unknown mnemonic <FoldStart>
- I checked the mot section documentation and don't see a way to force the labels to use the ":" qualifier

Now, I could, in theory, preprocess my file and remove any FoldStart/FoldEnd lines and feed the rest to vasm, but that's kinda absurd. Surely I'm just missing some mot-specific syntax rule here ?
VladR is offline  
Old 06 January 2020, 15:58   #2
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,045
It's at the start of the line, so I guess it is seen as a label. If you want to use it as a function/macro you need to indent probably.

Code:
 FoldStart ; wait_for_gpu_to_finish
wait_for_gpu_to_finish:
 .wait_gpu:
  cmp.l #DSP_DONE, gpuState
 bne .wait_gpu
 rts
 FoldEnd
Hedeon is offline  
Old 06 January 2020, 16:17   #3
VladR
Registered User
 
Join Date: Dec 2019
Location: North Dakota
Posts: 741
Quote:
Originally Posted by Hedeon View Post
It's at the start of the line, so I guess it is seen as a label. If you want to use it as a function/macro you need to indent probably.
That was actually it !!!


I just indented it by a Tab and it now doesn't see it as a label. It looks weird, indented like that, for the very first block, but I'm sure I'll get used to it soon.



I guess I will have many surprises like this one, converting my whole codebase...

Thanks
VladR 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
VASM named macro arguments guy lateur Coders. Asm / Hardware 20 01 October 2018 13:50
Vasm/Vlink odd issue linking roondar Coders. Asm / Hardware 7 10 December 2017 20:19
vasm movem optimization issue? dalton Coders. Asm / Hardware 2 23 September 2016 14:02
Trouble with macro parameters in VASM kazblox Coders. Asm / Hardware 2 03 January 2015 03:28
WAITBLIT macro phx Coders. Asm / Hardware 20 18 February 2014 14:22

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 01:31.

Top

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