flat assembler
Message board for the users of flat assembler.
Index
> Main > labels and includes |
Author |
|
Ralph 10 Oct 2003, 01:10
I rewrote that EQU in ivt.inc with a =, and it works now. Could anyone explain to me why?
|
|||
10 Oct 2003, 01:10 |
|
Dunduk 10 Oct 2003, 02:47
Ralph wrote: I rewrote that EQU in ivt.inc with a =, and it works now. Could anyone explain to me why? As I know "equ" is not equal to "=" in fasm... if I read right fasm documentation. "=" is used for definition constants and "equ" is used for definition symbolic constants. |
|||
10 Oct 2003, 02:47 |
|
Ralph 10 Oct 2003, 03:07
Yeah, EQU replaces it with a symbolic constant while = replaces it with the actual value. I just rewrote "Label EQU $-PreviousLabel" as:
Code: Label = NextLabel-PreviousLabel NextLabel: Just a different way of doing the same thing. I'm just curious as to why the = gets picked up and the EQU does not. Does that have to do with the scope? |
|||
10 Oct 2003, 03:07 |
|
scientica 10 Oct 2003, 04:47
Ralph wrote: I just rewrote "Label EQU $-PreviousLabel" as: When using Label in you code it will be replaced with $-PreviousLabel, so the value will vary depending on where in the code you are when you use it. But with "Label = $-PreviousLabel" you'll have the value of $ will be that which it has/had on the line where the label is defined. _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
10 Oct 2003, 04:47 |
|
Dunduk 10 Oct 2003, 05:18
When you define "Label equ $-SomeLabel" and use it in various places of code, you'll get various values of Label. And with "Label = $-SomeLabel" you will get the same value... Or I didn't understand what you wanted to say?
|
|||
10 Oct 2003, 05:18 |
|
Dunduk 10 Oct 2003, 05:21
Ooops, scientica already answered the question
|
|||
10 Oct 2003, 05:21 |
|
Ralph 10 Oct 2003, 05:35
Right, I understand that, hence the use of a hardcoded value instead of $. That wasn't my question :). I want to know why fasm complains about not finding a label when it is declared using EQU, but does when it is using =.
|
|||
10 Oct 2003, 05:35 |
|
Dunduk 10 Oct 2003, 05:46
Ralph wrote: I want to know why fasm complains about not finding a label when it is declared using EQU, but does when it is using =. Can you introduce some small piece of compilable code with that thing? Maybe we'll find the truth together. |
|||
10 Oct 2003, 05:46 |
|
Tomasz Grysztar 10 Oct 2003, 07:47
More about = and EQU here: http://board.flatassembler.net/topic.php?p=2283#2283
|
|||
10 Oct 2003, 07:47 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.