flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > irp and if and equ.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1980
Roman 13 Jul 2025, 07:31
fasmw 1.73
i want do this.
Code:
params equ 1,2,9,4

        irp v,params { 
mov eax,v ;fasm error mov eax,1,2,9,4

;I expected
;mov eax,1
;mov eax,2
;mov eax,9
;mov eax,4
        }
    


second variant
Code:
params equ 1,2,9,4,3,8,7
irp v,params { 
if v = 1
display 'a'
end if
if v = 2
display 'b'
end if
if v = 3
display 'c'
end if
if v = 4
display 'd'
end if
        }
    
Post 13 Jul 2025, 07:31
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1180
Location: Russia
macomics 13 Jul 2025, 07:34
Code:
params equ 1,2,9,4

match a, params {irp v,a \{ mov eax,v \}}    

Code:
params equ 1,2,9,4,3,8,7
match a, params { irp v,a \{ 
match =1, v \\{ display 'a' \\}
match =2, v \\{ display 'b' \\}
match =3, v \\{ display 'c' \\}
match =4, v \\{ display 'd' \\} \} }    


Last edited by macomics on 13 Jul 2025, 07:44; edited 2 times in total
Post 13 Jul 2025, 07:34
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1980
Roman 13 Jul 2025, 07:40
thanks.
Post 13 Jul 2025, 07:40
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.