flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid 20 Aug 2006, 09:03
well, you should read principes of FASM, to understand what is preprocessing. Macro is expanded at preprocessing stage before, "if"s are handled (in assemby stage). Also operator "used" is for checking value of numeric constants, not macros.
|
|||
![]() |
|
Dmitry 20 Aug 2006, 12:42
So, you should use 'match' directive
For example: Code: macro mytimer { ;;handler code } mytimer_present equ 1 ;; .if [uMsg] = WM_TIMER ; match =1,mytimer_present { mytimer } ; .endif |
|||
![]() |
|
ChrisLeslie 20 Aug 2006, 21:59
Dmitry
Ah!, the match directive. I can't wait to try that when I get home. Thanks for the advice. Regards Chris |
|||
![]() |
|
ChrisLeslie 22 Aug 2006, 03:08
No, I could get the match directive as above to work. I don't understand the code Dmitry however because if "mytimer_present" equate to 1 then the match will only be true, even if mytimer does not exist. How can the presence or not of the macro name be interpreted by the match? Or am I misunderstanding something...
Chris |
|||
![]() |
|
Dmitry 22 Aug 2006, 07:54
You should manually change this value.
mytimer_present equ 1 if mytimer macro present, otherwise 0 The improved version: Code: macro __macro name*, [params] { common name#_present equ 1 macro name params \{ } MACRO fix __macro ENDM fix } macro IFMDEF name* { match =1, name#_present \{ name \} } ;;macros MACRO mymacro xor eax,eax ENDM ;;code .if [uMsg] = WM_TIMER ; IFMDEF mymacro ; .endif |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.