flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Irp and equ values

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 24 Jul 2024, 10:11
Fasmw 1.73
Code:
;this work fine
irp value, 2,3,5 { db value }

;this not
OpsEq equ add, sub, get, set
irp value, OpsEq { eq_pp equ value 
display eq_pp ;I get add, sub, get, set
;but I expected get add than sub
}
    
Post 24 Jul 2024, 10:11
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 24 Jul 2024, 10:29
Ok. I try do this.
Code:
macro deEq nn,[pp] {
          forward
          nn equ pp
          }
    deEq eq_ops2,add,sub,do,init,get,set 
;in main code
rept 10 n:0 { lb#n:
       irpv e,eq_ops2 \{ if \e eq add
            add eax,9
            ret
            end if
if \e eq sub
            sub eax,9
            ret
            end if
            \}
       } 
    

Ida Pro show 10 times add eax,9.
But i expected one add eax,9
Post 24 Jul 2024, 10:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 24 Jul 2024, 17:07
Stage 1: Initialise eq_ops2.
Code:
irp value, add,sub,do,init,get,set { eq_ops2 equ value }    
Stage 2: enumerate eq_ops2.
Code:
irpv value, eq_ops2 { display `value,13,10 }    
Post 24 Jul 2024, 17: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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.