flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
IF and EQU are not compatible when used like that. IF is processed by the assembler, EQU by the preprocessor. In your code 'var' is always EQUated to '1'.
Instead, try using '='. Code: var = 0 |
|||
![]() |
|
l4m2
revolution wrote: IF and EQU are not compatible when used like that. IF is processed by the assembler, EQU by the preprocessor. In your code 'var' is always EQUated to '1'. |
|||
![]() |
|
l4m2
Mainly I wonder how to do with this
Code: if x in <(, [, \{> t equ x else if ~defined t goto _false |
|||
![]() |
|
revolution
Use MATCH instead of IF.
|
|||
![]() |
|
l4m2
Code: macro matche s{ local t irps x, s \{ if x in <(, [, \{> t equ x else if x eqtype 0 t equ num else if ~defined t goto _false else if x eq ) & t eq ( restore t else if x eq ] & t eq [ restore t else if x eq \} & t eq \{ restore t else if x eqtype eax & t eq num restore t else goto _false end if \} if defined t _false: var equ 0 else var equ 1 end if } with eqtype still use MATCH how? |
|||
![]() |
|
revolution
You can't use IF any other assembler operator like EQ or EQTYPE with RESTORE/MATCH/EQU like that. You'll need to use only preprocessor operators, or only assembler operators. You have to understand that the two stages are completely separate.
|
|||
![]() |
|
revolution
If you want an example to show one way to use MATCH look at the macro 'allow_nesting' in WIN32AX.inc.
|
|||
![]() |
|
l4m2
I didn't ask why not correct but how to make it correct, right?
|
|||
![]() |
|
revolution
l4m2 wrote: I didn't ask why not correct but how to make it correct, right? But I also think that writing a full parser in fasm preprocessor syntax will be very challenging. Perhaps Tomasz's suggestion about using fasmg (in your other thread) is worth considering. |
|||
![]() |
|
l4m2
Code: macro matche s{ local t irps x, s \{ if x in <(, [, \{> t = x else if ~defined t goto _false else if x eq ) & t eq ( =restore t else if x eq ] & t eq [ =restore t else if x eq \} & t eq \{ =restore t else goto _false end if \} if defined t _false: var = 0 else var = 1 end if } If using Control directives how to make the stack ? |
|||
![]() |
|
revolution
EQU pushes on the stack, RESTORE pops off the stack. IRPV enumerates the stack.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.