flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > [Solved]Problems match 2*1

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 03 Sep 2024, 01:23
Fasmw 1.73
I want cut 0*1 to a =* b
I do
Code:
macro xOp op {
match a =* b, op \{ display a \} 
} 
;in code
xOp 2*1 ;no display
xOp h*j ;display h

    


Last edited by Roman on 03 Sep 2024, 03:52; edited 1 time in total
Post 03 Sep 2024, 01:23
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20333
Location: In your JS exploiting you and your system
revolution 03 Sep 2024, 01:38
Works for me. But your example is broken.
Code:
flat assembler  version 1.73.31  (16384 kilobytes memory)

test.asm [6]:
xOp h*j ;display h
test.asm [2] xOp [1]:
match a =* b, op \{ display a \} 
test.asm [2] match [0]:
match a =* b, op \{ display a \} 
processed: display h
error: undefined symbol 'h'.
    
A better example is this.
Code:
macro xOp op {
match a =* b, op \{ display \`a \} 
} 
;in code
xOp 2*1 ;display 2
xOp h*j ;display h    
Code:
flat assembler  version 1.73.31  (16384 kilobytes memory)
2h
1 passes, 0 bytes.    
Post 03 Sep 2024, 01:38
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20333
Location: In your JS exploiting you and your system
revolution 03 Sep 2024, 01:39
I suspect you are outputting the character 0x02, which is a non-printing character so you don't see it.

See the "blank" line in the output above, there is a character 0x02 hidden there.
Post 03 Sep 2024, 01:39
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 03 Sep 2024, 01:45
And how get Option from match?
I mean symbol * or + or / or -
Using for each symbol separate match?
Post 03 Sep 2024, 01:45
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1792
Roman 03 Sep 2024, 03:33
helped me, chinese karate master Chu Smile
Code:
macro xchu op,do,op1 {
      ueqqu equ 0
      match &a=op &b , op1 \{
            movaps xmm0,dqword [a]
            do xmm0,dqword [b]
            display 'adr;'
            ueqqu equ 1
            \}
      match a=op b , op1 \{
           ; display \`a
           ; display \`b
            if ueqqu = 0
            display 'xmm;'
            do xmm\#\a,xmm\#\b
            end if            \}
}
macro xmOp4 op1 {       
      xchu *,mulps,op1
      xchu /,divps,op1
      xchu +,addps,op1
      xchu -,subps,op1  
      }
;in code 
align 16
p1 dd 1.0,2.0,3.0,4.0
p2 dd 10.0,20.0,30.0,40.0

        xmOp4 &p2-&p1
        xmOp4 0*2
        xmOp4 &p2*&p1
        xmOp4 &p2/&p1
    
Post 03 Sep 2024, 03:33
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.