flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
macomics 07 May 2023, 07:00
equ - preprocessor
if .. else .. end if - assembler To control conditional assignment of values by equ, you need to use match instead of if .. else .. end if. |
|||
![]() |
|
Roman 07 May 2023, 10:23
Quote: if .. else .. end if - assembler How about if in match ? Code: match x , something { if x = 1 end if ) |
|||
![]() |
|
macomics 07 May 2023, 10:43
Roman wrote: How about if in match ? Code: define something 1 define some_else 2 match x , something { if x = 1 define a 5 end if display `x, 13, 10 match u, a \{ display \`u, 13, 10 \} } match x , some_else { if x = 1 define b 4 end if display `x, 13, 10 match u, b \{ display \`u, 13, 10 \} } Code: ; define something 1 ; define some_else 2 ; match x, something { if 1 = 1 ; define a 5 end if display '1', 13, 10 ; match u, a \{ display '5', 13, 10 ; \} ;} ; match x, some_else { if 2 = 1 ; define b 4 end if display '2', 13, 10 ; match u, b \{ display '4', 13, 10 ; \} ;} Code: if 1 = 1 ; true end if display '1', 13, 10 ; show 1 display '5', 13, 10 ; show 5 if 2 = 1 ; false end if display '2', 13, 10 ; show 2 display '4', 13, 10 ; show 4 Code: $ fasm main.asm -m 64 flat assembler version 1.73.30 (64 kilobytes memory) 1 5 2 4 1 passes, 0 bytes. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.