flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > @F. A bug or not a bug? |
Author |
|
LocoDelAssembly 20 May 2011, 02:13
Just to add, FASM 1.64 faults at "if defined @B" with "Error: invalid value" message.
On FASM 1.69.31 I get the same error as reported, except for "if defined @F" which makes the code compile fine. |
|||
20 May 2011, 02:13 |
|
l_inc 21 May 2011, 10:41
Well... if none (including well slept me) disagrees, then I'd like to show another occurrence of probably same bug. Compiling the following code
Code: jmp @FFF if defined @FF display '@FF defined',13,10 label @FFF at @FF end if if defined @F display '@F defined',13,10 label @FF at @F end if @@: produces the following output: Code: @FF defined @F defined C:\test.asm [1]: jmp @FFF error: undefined symbol '@FFF'. , which is weird, because if "@FF defined", then @FFF must also be defined. Does fasm forget to make one more pass to resolve the label? |
|||
21 May 2011, 10:41 |
|
idle 22 May 2011, 17:18
so, does every label definition require a new pass?
won't the chaining suspend fasm in real situations: jmps, ands, ors, xors etc adds, subs, etc? Code: jmp i_have_a_car_and_the_car_is_mine: if the_car_is_mine: i_have_a_car_and_the_car_is_mine: end if if i_have_a_car: the_car_is_mine: end if i_have_a_car: |
|||
22 May 2011, 17:18 |
|
idle 22 May 2011, 17:38
old expert systems such as TProlog or Guru would do:
;well, mark unresolved#1 and continue jmp i_have_a_car_and_the_car_is_mine: ;mark unresolved#2 and continue if the_car_is_mine: ;mark unresolved#3 and continue if i_have_a_car: ;fix knowledge base i_have_a_car: ;go last unresolved i.e. #3 |
|||
22 May 2011, 17:38 |
|
Tomasz Grysztar 15 Sep 2011, 21:23
Both the bugs are fixed in 1.69.33.
|
|||
15 Sep 2011, 21:23 |
|
l_inc 16 Sep 2011, 11:48
Tomasz Grysztar
Thank you very much! Now it's possible to do the following kind of nasty things. Code: macro def@@ ..@F { macro @@ [args] \{ \common \local ..@BB, ..@FF, matched, remainder define matched - match : rem, args \\{ restore matched define matched + \\} match :, args \\{ restore matched define matched + \\} match +, matched \\{ restore @BB @BB equ ..@BB if defined @B label ..@BB at @B end if purge @@ @@: restore @FF @FF equ ..@FF def@@ ..@FF if defined @F label ..@F at @F end if match : rem, args \\\{ remainder equ rem \\\} match :, args \\\{ remainder equ \\\} remainder restore remainder \\} restore matched \} } match any,any { local ..@FF restore @FF @FF equ ..@FF def@@ ..@FF } There were some humble requests for this feature, but as far as I understood, there had been no working solutions provided. Usage example: Code: @@: jmp @FF @@: jmp @B @@: jmp @BB jmp @BB jmp @B Kind regards P.S. It seems to work with previous versions either. I was so badly waiting for this update. |
|||
16 Sep 2011, 11:48 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.