flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > EQU with diferent names in macro. Fasm 1.73

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 26 Dec 2018, 10:53
I want do like this
Code:
macro BeginLoop chReg,chVal {local l1
Lab#chReg EQU l1
mov chReg,chVal 
l1:
}

macro EndLoop chReg {
dec chReg
test chReg,chReg
jnz Lab#chReg
}

mov eax,0
BeginLoop ebp,11
BeginLoop ecx,4
add eax,5
EndLoop ecx
EndLoop ebp
    


Fasm get error on Lab#chReg EQU l1
Post 26 Dec 2018, 10:53
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20447
Location: In your JS exploiting you and your system
revolution 26 Dec 2018, 11:40
Your code works for me:
Code:
flat assembler  version 1.73.02  (2359008 kilobytes memory)
1 passes, 36 bytes.    
Post 26 Dec 2018, 11:40
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 26 Dec 2018, 11:47
I try compile
Code:
Start:
Lab#chReg EQU l1
l1:
    


and fasm get me error.
And i think my macro not compile too.


Last edited by Roman on 26 Dec 2018, 12:11; edited 2 times in total
Post 26 Dec 2018, 11:47
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 26 Dec 2018, 11:48
I try compile my macro BeginLoop
and fasm compile fine !

Hm.
Post 26 Dec 2018, 11:48
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20447
Location: In your JS exploiting you and your system
revolution 26 Dec 2018, 12:27
The hash (#) character doesn't operate outside of the preprocessor (macro, rept, etc.)
Post 26 Dec 2018, 12:27
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 26 Dec 2018, 15:27
Aha !
Thanks for you help.
Post 26 Dec 2018, 15:27
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.