flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Num = eax or register and if Num = 10. How do this ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 605
Roman
I have macro
macro must get register value and do if.
Num EQU eax
if Num = 10
mov eax,2
end if

How do this ?
Post 11 Oct 2015, 12:49
View user's profile Send private message Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 257
Trinitek
Code:
Num equ eax
cmp Num, 10         ; equivalent to cmp eax, 10
jne @f
mov eax, 2
@@:    
Preprocessor statements can only be used during preprocessing, not during runtime. You need to use real instructions to do the comparison during runtime.
Post 11 Oct 2015, 18:54
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 605
Roman
O ! Thanks.
Its good solution for me.
Post 12 Oct 2015, 05:13
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.