flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > [Solved]error macro for many args. How Fix ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 2090
Roman 25 Jul 2026, 17:42
fasmw 1.73

Code:
macro @b. [arg] { common
     DONE equ xxNO
     match dst==[src], arg
     \{ 
        mov al,byte [src]
        mov byte [dst],al
        DONE equ xxYES 
     \}
      match =xxNO dst==src, DONE arg
     \{
        mov byte [dst],src
        DONE equ xxYES 
     \}
     match =xxNO, DONE
     \{ 
       must ". val = reg or num or [val or reg]"
     \}
    }                 

;in code this fasm error
@b. ShapeDef2.isSensor = 1,\
    ShapeDef2.enableSensorEvents = 1

;this fasm ok
@b. ShapeDef2.isSensor = 1
        
    


Last edited by Roman on 25 Jul 2026, 18:54; edited 1 time in total
Post 25 Jul 2026, 17:42
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 21027
Location: In your JS exploiting you and your system
revolution 25 Jul 2026, 18:46
It isn't clear what is the desired goal here, but must is not a valid instruction. Is that the error that fasm outputs?
Code:
processed: must '. val = reg or num or [val or reg]'
error: illegal instruction.    
Otherwise maybe this?
Code:
macro @b. [arg] { forward
     DONE equ xxNO
     match dst==[src], arg
     \{ 
        mov al,byte [src]
        mov byte [dst],al
        DONE equ xxYES 
     \}
      match =xxNO dst==src, DONE arg
     \{
        mov byte [dst],src
        DONE equ xxYES 
     \}
     match =xxNO, DONE
     \{ 
       must ". val = reg or num or [val or reg]"
     \}
    }                 

;this fasm ok
@b. ShapeDef2.isSensor = 1

;in code this fasm error
@b. ShapeDef2.isSensor = 1,\
    ShapeDef2.enableSensorEvents = 1, \
    ShapeDef2.enableSensorEvents = [ShapeDef2.isSensor]

ShapeDef2.isSensor db ?
ShapeDef2.enableSensorEvents db ?    
BTW: It is easier to help if the example code can be compiled directly, without having to guess at other things needed in the source to reproduce whatever error is given. And also please show the error that fasm displayed.
Post 25 Jul 2026, 18:46
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 2090
Roman 25 Jul 2026, 18:52
Thanks.
Post 25 Jul 2026, 18:52
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-2026, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.