flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > How use $ like label ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1820
Roman 25 Jan 2019, 14:31
I know $ get current adress.
Code:
 $1
 inc [loop_count]
 $2     ;i want jnz do loop here.
 dec ecx
 test ecx,ecx
 jnz $2 ;but jnz do loop on themselves.
 dec edx
 test edx,edx
 jnz $1
    


I know @f and @b but if we write two @b or @f we might jnz not right adress.
I know about local labels in macro.
I know about labels. And for labels must write name and jnz name.
Some times its not handful.


Last edited by Roman on 25 Jan 2019, 14:39; edited 2 times in total
Post 25 Jan 2019, 14:31
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 25 Jan 2019, 14:37
If you do not want $ to mean what it normally means, you can replace it with help of preprocessor:
Code:
$ equ _$

$:
 dec ecx
 test ecx,ecx
 jnz $    
Post 25 Jan 2019, 14:37
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1820
Roman 25 Jan 2019, 14:45
Thanks Tomasz !
Post 25 Jan 2019, 14:45
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.