flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Forcing addressing modes

Author
Thread Post new topic Reply to topic
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Well this is a continuation of http://board.flatassembler.net/topic.php?p=32657#32657

Now the feature request Very Happy

Can be added to FASM the ability to decide how addressing operands must be assembled?

Example:

When I do "lea eax, [eax+ dword 0]" I want FASM assemble the lea instruction with the offset too. At this time that instuction generates an error and if I do "lea eax, [eax+0]" FASM assembles "lea eax, [eax]". I know, assemblers must choice the shortest encoding but I want to override that using the size operator in the offset. FASM already support something similar when I do "add eax, dword 0", I just want to do the same with offsets.

Regards,
LocoDelAssembly
Post 28 Nov 2005, 14:37
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7755
Location: Kraków, Poland
Tomasz Grysztar
I have just replied there before seeing this post.

Note that it is documented in section 1.2.6, even though a bit curtly .
Post 28 Nov 2005, 14:42
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
I see, so why "byte" can't be used (apart FASM doesn't support that)? I know it's the default encoding but as you said, the default mode performs some optimisations. Also it could be useful "byte" when I'm looking for making some code shortest as possible, if FASM says me "value out of range" then I know I must do some adjustments in my code.

Regard,
LocoDelAssembly
Post 28 Nov 2005, 15:12
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7755
Location: Kraków, Poland
Tomasz Grysztar
This is actually the thing that was discussed here: http://board.flatassembler.net/topic.php?t=3866

Some of the first fasm versions allowed "byte" in all such places, but then I changed my mind. I explained there, why.
Post 28 Nov 2005, 20:28
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Aaaaah, I know now why this topic sounds familear to me. Well I'm not so sure that this is a good desing but I'm not a assembly guru so I will trust your desing is fine.

Anyway, what I'm wanting can be achieved using macros and match directive, no?

Thanks for your answers!!
Post 28 Nov 2005, 22:09
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.