flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > lea eax,[ebx + 1.7E4]

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji
Code:
; 1.7E4 == 4684D000h

lea eax, [ebx + 4684D000h]  ;"A" does compile

lea eax, [ebx + 1.7E4]               ;"B" does not compile (invalid name)

    
I don't understand why "B" is not allowed.
There is no reason to prohibit it.
It is the responsibility of the programmer to make sense of this,
but the compiler should not prohibit it.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 14 Nov 2011, 23:38
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16892
Location: In your JS exploiting you and your system
revolution
ouadji wrote:
It is the responsibility of the programmer to make sense of this,
That makes no sense. Floating point numbers are generally imprecise, and trying to use them as address offsets is silly.
Post 15 Nov 2011, 00:01
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2914
Location: 0x77760000
typedef
Laugh Out Loud
Post 15 Nov 2011, 00:19
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
Rolling On The Floor Laughing My Ass Off
Post 15 Nov 2011, 04:45
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

it's not the compiler to choose what does make sense and what does not.
Here, it's not a matter about the sémantic field, but a matter of dialectic.
It seems that the top-flight thought is not accessible to everyone. Wink
Quote:
and trying to use them as address offsets is silly.
Why always "an address offset" ?
"lea" can be used for many other things and all algorithms are possible.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 15 Nov 2011, 09:48
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16892
Location: In your JS exploiting you and your system
revolution
Do you have a situation where it would make sense? What were you trying to do when you encountered this "problem"?
Post 15 Nov 2011, 10:39
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2914
Location: 0x77760000
typedef
He thought FASM would convert 1.7E4 to it's 32 bit equivalent.

and therefore end up with lea eax, [ebx + 4684D000h]

What a fail.... still LOL-ing
Post 15 Nov 2011, 11:13
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

Quote:
Do you have a situation where it would make sense?
no

fasm should not limit the ability of the programmer by hypotheses about the sense or the nonsense of a line of code. it's not his role. Here, the compiler makes an assumption,his function is not to make assumptions.


(sorry for my bad english, i do my best)

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 15 Nov 2011, 11:19
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7489
Location: Kraków, Poland
Tomasz Grysztar
It was allowed once: http://board.flatassembler.net/topic.php?p=12398#12398
But later (sometime around 1.59) it was disallowed once again, because people were keeping reporting this as a bug and with later parser improvements it was no longer needed even for macros.
Post 15 Nov 2011, 11:28
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

still "LOL-ing" typedef ? Wink

thank you Tomasz for this reply.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 15 Nov 2011, 11:42
View user's profile Send private message Send e-mail Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
tbh it made me laugh too.

1.7E4 has more than one possible representation, so it's probably a good thing that it has to be done specifically via macros/defines.
Post 15 Nov 2011, 19:22
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2145
Location: Estonia
Madis731
1.7E4 == 17000? 0x4268
What a confusion Razz
Post 22 Nov 2011, 08:31
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

1.7E4f

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 22 Nov 2011, 10:25
View user's profile Send private message Send e-mail Reply with quote
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler
1.7e4.0
Post 22 Nov 2011, 14:15
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

1.7E4.0 Question Question
Code:
mov eax, 1.7E4.0 ;does not compile
mov eax, 1.7E4f  ;does compile
    


_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 22 Nov 2011, 17:43
View user's profile Send private message Send e-mail 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-2019, Tomasz Grysztar.

Powered by rwasa.