flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > include data only once

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 22 Dec 2024, 13:22
fasmw 1.73
Code:
macro vecAdd v1=we1,v2=we2 { local .a
                             movups xmm0,dqword [v1]
                             movups xmm1,dqword [v2]
                             addps  xmm1,xmm0
if ~defined we1 | @f
jmp .a
we1 dd 0,0,0,0
we2 dd 0,0,0,0
.a:
end if
}
Start:  vecAdd ;ok
        vecAdd  ;fasm error symbol we1 already defined.

    

I want ignored data we1 and we2 in second vecAdd
Post 22 Dec 2024, 13:22
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1041
Location: Russia
macomics 22 Dec 2024, 16:03
Code:
macro vecAdd v1=we1,v2=we2 { local .a
                             movups xmm0,dqword [v1]
                             movups xmm1,dqword [v2]
                             addps  xmm1,xmm0
if ~defined we1 | @f
@@: jmp .a
we1 dd 0,0,0,0
we2 dd 0,0,0,0
.a:
end if
}
Start:  vecAdd ;ok
        vecAdd  ;fasm error symbol we1 already defined.    
Post 22 Dec 2024, 16:03
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 22 Dec 2024, 17:46
this work.
Code:
macro vecAdd v1=we1,v2=we2 { local aa
                             movups xmm0,dqword [v1]
                             movups xmm1,dqword [v2]
                             addps  xmm1,xmm0
if ~definite we1

 jmp aa
we1 dd 0,0,0,0
we2 dd 0,0,0,0
aa:
end if

}
Start:  vecAdd
        vecAdd     
Post 22 Dec 2024, 17:46
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.