flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > labels and macro

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1794
Roman 14 May 2020, 21:06
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: 20342
Location: In your JS exploiting you and your system
revolution 14 May 2020, 22:55
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: 1794
Roman 15 May 2020, 06:46
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: 20342
Location: In your JS exploiting you and your system
revolution 15 May 2020, 07:52
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: 1794
Roman 15 May 2020, 07:57
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: 20342
Location: In your JS exploiting you and your system
revolution 15 May 2020, 08:07
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.