flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Fasm 1.73 labels and macro

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 598
Roman
Code:
macro x { local l1
l1:
}
.22: mov al,2
       x
.33:
 cmp al,3
 jbe .33
    


fasm get error. Not found .33

I fixed macro x:
macro x { local .l1
.l1:
}
Did this fix right for macro x ?

Second question.
What is good\more stable for fasm Fix or EQU(using in some procs and macro) ?
I want write many(2000) EQU


Last edited by Roman on 15 May 2020, 06:52; edited 2 times in total
Post 14 May 2020, 21:06
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
Roman wrote:
Code:
macro x { local l1
l1:
}
.22: mov al,2
       x
.33:
 cmp al,3
 jbe .33
    


fasm get error. Not found .33
Works for me.
Code:
1 passes, 6 bytes.    
Post 14 May 2020, 22:55
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 598
Roman
Try
Code:
macro x { local l1
jmp l1
l1:
}
.22: mov al,2
       x
.33:
 cmp al,3
 jbe .22
    

Get me error: undefined symbol 'l1?g.22'
Post 15 May 2020, 06:46
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
This is normal. You are defining a new base label with the macro x.

Try this:
Code:
macro x { local ..l1
jmp ..l1
..l1:
}
.22: mov al,2
       x
.33:
 cmp al,3
 jbe .22    
The double dot does not create a new base name for the single dot labels.
Post 15 May 2020, 07:52
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 598
Roman
Hm.
Interesting.
Thanks.

I try this and work !
Code:
 .23:
 ..23:
 ...23:
 jnz .23
 jnz ..23
 jnz ...23
    


Last edited by Roman on 15 May 2020, 11:03; edited 1 time in total
Post 15 May 2020, 07:57
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
Note that the macro is not the cause here.
Code:
.22:
l1: jmp .22 ;error    
Compare to:
Code:
.22:
..l1: jmp .22 ;okay    
Post 15 May 2020, 08:07
View user's profile Send private message Visit poster's website 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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.