flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Main > How to use relativeto in fasmg?

Author
Thread Post new topic Reply to topic
l4m2



Joined: 15 Jan 2015
Posts: 597
How to use relativeto in fasmg?

Code:
a equ 12
b equ 12 + x
if a relativeto x
  display 'Hi'
end if


If x is not defined, it says

fasmg wrote:
Error: symbol 'x' is undefined or out of scope.



Code:
a equ 12 * x
b equ 12 + x
x=0
if a relativeto x
  display 'Hi'
end if


If x is defined, it displays, regardless of whether x-a is a constant.
Post 15 Aug 2016, 10:37
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6676
Location: Kraków, Poland
This works the same as in fasm - if you assemble the above samples with fasm 1.71, you're going to get the same results.

The only difference is that in fasm "relativeto" can only be used to check if expression is relative to one of the addressing symbols pre-defined by the assembler (like "if a relativeto ebx"), while in fasmg you freely define such symbols yourself, with "element" directive:

Code:
element x
a equ 12
b equ 12 + x 

if a relativeto x
  display 'a'
end if

if b relativeto x
  display 'b'
end if

Post 15 Aug 2016, 11:46
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.