flat assembler
Message board for the users of flat assembler.
Index
> Main > Problem with equates |
Author |
|
JohnFound 11 Jan 2004, 13:07
madmatt wrote:
it should be: Code: RNDC.NDIV equ 1+(RNDC.IMM1 / RNDC.NTAB) Only NTAB is 0, so you can't divide on it. And better use "=" instead of "equ". Regards |
|||
11 Jan 2004, 13:07 |
|
madmatt 11 Jan 2004, 13:32
Can't believe I missed that!!! I Need to have my eyes checked!
Thanks JohnFound! Why use = instead of equ? |
|||
11 Jan 2004, 13:32 |
|
JohnFound 11 Jan 2004, 13:49
madmatt wrote: Why use = instead of equ? Well, in FASM "=" is not equal to "equ" like in some other assemblers. "equ" defines symbolic constant in very early stage of compiling. And then when you are using this symbol, FASM make simply text replacing, not value replacing. For example if you define something in the "if" condition, it will be defined even when the condition is false. Simply because definition is on preprocessing stage, but conditions are computed/executed on assembling stage. Of course "equ" is useful in many cases, but only if you know exactly why you doing this. The same is valid for "fix" directive. It is very similar to "equ". On other hand, constants defined with "=" are true numerics and FASM defines/redefines them on assembling stage. (btw on this stage, the source does not exists as text, but as internal "pseudocode" data). Regards |
|||
11 Jan 2004, 13:49 |
|
HarryTuttle 11 Jan 2004, 19:18
I have another problem with 'equ'
I'd like to cut invoke function to its shorter version 4 example : inv but i noticed that : Code: inv equ invoke the assembler talk to me that the instruction I want to call,it is illegal. what should I write to be shorter. regards, harry _________________ Microsoft: brings power of yesterday to computers of today. |
|||
11 Jan 2004, 19:18 |
|
JohnFound 11 Jan 2004, 20:00
HarryTuttle wrote: what should I write to be shorter. Code: inv fix invoke Regards |
|||
11 Jan 2004, 20:00 |
|
Joshua 11 Jan 2004, 20:02
inv fix invoke
|
|||
11 Jan 2004, 20:02 |
|
HarryTuttle 12 Jan 2004, 06:38
I overlooked "fix" and like in MASM tied to use equ.
BTW:J-now E-thing work well. thank You! h _________________ Microsoft: brings power of yesterday to computers of today. |
|||
12 Jan 2004, 06:38 |
|
madmatt 12 Jan 2004, 10:38
Quote: Well, in FASM "=" is not equal to "equ" like in some other assemblers. Thanks Jounfound, this would be good to know for conditional assembly. which I haven't needed yet. but will most likely need in the future for assembling code for different processors. |
|||
12 Jan 2004, 10:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.