flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Float & int macro.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1315
Roman 20 Dec 2022, 10:22
Idea separate floats and ints numbers to AllFlts and AllInts .
Code:
;Data
AllFlts dd 10.0,11.5,4.5
AllInts dd 5,8,4

macro xadd v1,a,v2,b {
if v1 = AllFlts
movss xmm0,[v1+a*4]
end if
if v1 = AllInts
mov eax,[v1+a*4]
end if
if v2 = AllInts
   if v1 = AllFlts
        cvtsi2ss xmm1,[v2+b*4]
        addss xmm0,xmm1
   end if
   if v1 = AllInts
        add eax,[v2+b*4]
   end if
end if
if v2 = AllFlts
addss xmm0,[v2+b*4]
end if
      } 

xadd    AllFlts,1,AllInts,1
xadd    AllFlts,0,AllFlts,0
xadd    AllInts,2,AllInts,2  
    

My question, how macro know is this AllFlts+4 or AllInts+8 ?
Post 20 Dec 2022, 10:22
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-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.