flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Unrecoverable label redifinition and numeric variable forwar |
Author |
|
Tomasz Grysztar 01 Apr 2012, 09:17
It might be possible in theory, but it wouldn't go well with fasm's implementation. It would have incomplete track of some of the values and it would no longer be able to guarantee the correctness of generated solution.
|
|||
01 Apr 2012, 09:17 |
|
l_inc 01 Apr 2012, 11:06
Tomasz Grysztar
Could you provide an example of what exactly would be tracked incompletely? Because I see no crucial difference between the subject and e.g. rb -1. |
|||
01 Apr 2012, 11:06 |
|
Tomasz Grysztar 01 Apr 2012, 13:23
l_inc wrote: Because I see no crucial difference between the subject and e.g. rb -1. However, I think I found out a possible way to get this working correctly. I'm trying to make a formal proof - if I succeed in proving its correctness, I will implement such improvement. |
|||
01 Apr 2012, 13:23 |
|
Tomasz Grysztar 01 Apr 2012, 13:37
BTW, "out of scope" has always been recoverable, for example this resolved without error:
Code: if ~ defined y dd a end if a = 1 a = 3 label y |
|||
01 Apr 2012, 13:37 |
|
l_inc 01 Apr 2012, 13:47
Tomasz Grysztar
Quote: Tracking of label values is what the fasm's resolving algorithm relies on, and this is that crucial difference. Label values are not constant between the passes. Thus forward referencing a label or numeric constant, that changes it's value after it has already been used, seems to be equivalent to forward referencing a numeric constant, that later becomes a numeric variable. So the final decision about the error can be made the same way after the numeric variability has been stabilized. And label redefinition seems to be equivalent to a numeric constant becoming a numeric variable. Quote: You were deceived by the fact that currently after fasm sees numerical constant redefined once, it never allows it to be forward referenced Well, I never talked about the "out of scope" error as such. I talked about the numeric variable forward referencing. However in this case it's more reasonable to talk about unrecoverable state than about an unrecoverable error. P.S. Quote: I'm trying to make a formal proof Cool. It's good know, fasm is partially based on formal correctness proofs. |
|||
01 Apr 2012, 13:47 |
|
Tomasz Grysztar 01 Apr 2012, 14:48
Well, it not go well, as I was afraid it would. After I ensured correctness, fasm started to go into infinite loops ("code cannot be generated") instead of signalizing simple errors.
|
|||
01 Apr 2012, 14:48 |
|
l_inc 01 Apr 2012, 14:59
Tomasz Grysztar
A negative result is also a result. Thank you for the attempt. P.S. I'd probably try it by myself, but this requires deep understanding of fasm sources which lays beyond my abilities. |
|||
01 Apr 2012, 14:59 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.