flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > eqtype bug? |
Author |
|
Tomasz Grysztar 13 Jan 2006, 18:55
Each unknown name for assembler is a label, it doesn't matter whether it actually gets defined or not - you can put a label inside the "if 0" block so it never gets defined actually, but it doesn't change a fact that for assembler it is a label - thus part of numerical expression.
So "xxx" is of the same type as "+xxx" and "xxx+0" - they are all numerical expressions (and "+xxx" is in fact equivalent to "xxx" for the assembler, so "xxx eq +xxx" is true condition). Last edited by Tomasz Grysztar on 13 Jan 2006, 19:03; edited 2 times in total |
|||
13 Jan 2006, 18:55 |
|
Tomasz Grysztar 13 Jan 2006, 18:59
As for the second problem you can do it like:
Code: macro xxx p1, p2 { define eqtype eqtype define 0 0 if ~ p1 eqtype 0 err end if restore eqtype,0 } define 0 somethin' define eqtype ... xxx 5, 10 |
|||
13 Jan 2006, 18:59 |
|
Tomasz Grysztar 13 Jan 2006, 19:05
And for the third one: the "err" is something like "ud2" opcode - you can be sure it will always cause an error and is fully backward-compatible, since there always wasn't any instruction of such name (except, of course, when you define such macro etc.)
|
|||
13 Jan 2006, 19:05 |
|
Borsuc 13 Jan 2006, 19:07
Tomasz Grysztar wrote: Each unknown name for assembler is a label, it doesn't matter whether it actually gets defined or not - you can put a label inside the "if 0" block so it never gets defined actually, but it doesn't change a fact that for assembler it is a label - thus part of numerical expression. how to check if it is a number or is it impossible? thanks for other replies. |
|||
13 Jan 2006, 19:07 |
|
Tomasz Grysztar 13 Jan 2006, 19:16
"eqtype" doesn't distinguish numerical expression, so any solution would be a tricky one.
|
|||
13 Jan 2006, 19:16 |
|
Borsuc 13 Jan 2006, 19:25
just kidding i'm not sad thx EDIT: what's ud2? It compiled ok.. I thought it was just an arbitrary name? |
|||
13 Jan 2006, 19:25 |
|
Tomasz Grysztar 13 Jan 2006, 20:10
For UD2 see the Intel manuals.
|
|||
13 Jan 2006, 20:10 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.