flat assembler
Message board for the users of flat assembler.

Index > Main > EXTRN constants define?

Author
Thread Post new topic Reply to topic
fonolite



Joined: 14 Dec 2005
Posts: 32
fonolite
EXTRN XYZ (XYZ is constant)

mov eax, XYZ => OK

But,

DW XYZ => error:invalid use of symbol

How can I do define-byte from external constants?
Post 09 Jan 2006, 12:14
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
Both ELF anf COFF format don't have an 8-bit type of relocation, and as for the 16-bit one, it's only COFF that has the code reserved for such type, but it is said to be not supported anyway. For this reason fasm is able to generate only 32-bit and 64-bit relocations, thus if you define XYZ as external (and thus it needs relocation to be filled with right value), you can use it only with either DD or DQ - that's why you've got the above error.
Post 16 Jan 2006, 09:35
View user's profile Send private message Visit poster's website Reply with quote
fonolite



Joined: 14 Dec 2005
Posts: 32
fonolite
Thanks a lot. Smile

dd constant is OK!.

But, it seems inconvenient for some cases

like dw selector-constant.

Thanks anyway Smile
Post 16 Jan 2006, 10:03
View user's profile Send private message 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


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.