flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
macomics 11 Oct 2022, 17:58
Code: ee eq addss e2 equ xmm1 Code: vv equ xmm2 Code: ee e2,vv ; addss xmm1, xmm2 You got what you wrote yourself. The macro works correctly. |
|||
![]() |
|
Roman 11 Oct 2022, 18:08
But why ?
if b#_type = 2 ;i expect this display '2yes;' ;mov ebx,[b] vv equ [b] else ;else must work if b#_type not 2 display '2no;' cvtsi2ss xmm2,[b] vv equ xmm2 ;but get this ! Why ? end if |
|||
![]() |
|
macomics 11 Oct 2022, 18:11
Because if is handled by an assembler, and equ is handled by a preprocessor. First, everything related to the preprocessor is calculated, and then the assembler starts working. Macro substitution is also handled by the preprocessor.
Last edited by macomics on 11 Oct 2022, 18:13; edited 1 time in total |
|||
![]() |
|
Roman 11 Oct 2022, 18:12
And how fix this ?
|
|||
![]() |
|
macomics 11 Oct 2022, 18:14
Try using match
|
|||
![]() |
|
Roman 11 Oct 2022, 18:16
Quote: using match I'm in shoke ![]() I do more simple Code: macro app a,b { if a#_type = 2 cvtsi2ss xmm0,[a] else movss xmm0,[a] end if if b#_type = 2 cvtsi2ss xmm1,[b] else movss xmm1,[b] end if addss xmm0,xmm1 } |
|||
![]() |
|
Roman 11 Oct 2022, 18:44
How do somthing like this ? Fasm get me error
Code: if a#_type = b#_type = 4 display 'rt;' end if Its right variant ? Code: if a#_type = b#_type & a#_type = 4 display 'rt;' end if |
|||
![]() |
|
macomics 11 Oct 2022, 19:03
Code: if a#_type = 4 & b#_type = 4 display "Hello",13,10 end if |
|||
![]() |
|
Roman 11 Oct 2022, 19:07
Thanks. Work
Code: macro app a,b,c { if a#_type = 4 & b#_type = 4 movss xmm0,[a] addss xmm0,[b] end if if a#_type = 2 & b#_type = 2 mov eax,[a] add eax,[b] end if if a#_type = 4 & b#_type = 2 cvtsi2ss xmm0,[b] addss xmm0,[a] end if if a#_type = 2 & b#_type = 4 cvtsi2ss xmm0,[a] addss xmm0,[b] end if if c#_type = 4 movss [c],xmm0 else cvtss2si eax,xmm0 mov [c],eax end if } |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.