flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Compare eax and [eax]

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1892
Roman 23 Mar 2023, 04:20
Fasmw 1.73
Situation. Macro check a, b {...}
My Macro must show equal if a = eax and b =[eax]
Because the same register.
How do this?
Using eq or eqtype ?
Or another way, how apply a [] and get a=[eax] and b=[eax]?
Or do match for b and cut [] and get b=eax

And how separate alphabet chars and symbols like [,], *, {,}, &?

Or if a eq eax then aeq equ 1
If b eq [eax] then beq equ 1
If aeq=beq then a and b equal.
Post 23 Mar 2023, 04:20
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1118
Location: Russia
macomics 23 Mar 2023, 06:13
Code:
macro t a, b
{   match =[x=], b
    \{  if a eq x
            display "1"
        else
            display "2"
        end if
    \}
}

t eax, [eax]
t eax, [ecx]    
Code:
flat assembler  version 1.73.30  (1024 kilobytes memory)
12
1 passes, 0 bytes.    
Post 23 Mar 2023, 06:13
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1892
Roman 23 Mar 2023, 07:08
Thanks. Work.

How macro say check [] or & or () Or {}?
Choice for macro variant.

Or only way is writed in macro all matchs for symbols [] and {} and & and ()?
Post 23 Mar 2023, 07:08
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20593
Location: In your JS exploiting you and your system
revolution 23 Mar 2023, 09:03
eq works fine also.
Code:
macro tst a, b {
        if [a] eq b
                display `a,13,10
        end if
}
tst eax,[eax]
tst ebx,[eax]
tst bx,[bx]    
Post 23 Mar 2023, 09:03
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1892
Roman 23 Mar 2023, 09:52
If not work
Code:
 
If (eax) eq (eax) ;fasm error
match = (x=), b {if a eq x};ok no error

     
Post 23 Mar 2023, 09:52
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.