flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > EXPRPARS.INC/fp_before_dot:

Author
Thread Post new topic Reply to topic
ouadji



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

about "b", ok, i understand, i'm agree.
but "a" seems unnecessary.
What is the purpose of this instruction "a"? (mov al,[esi])
This question is not to bore you Tomasz, not at all,
but just to understand. Thank you.
Code:
;EXPRPARS.INC

       call    fp_optimize
 mov     [fp_format],0
       mov     al,[esi]        ;<----- a ???
fp_before_dot:
      lods    byte [esi]      ;<----- b
        cmp     al,'.'
    je      fp_dot

    

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 29 Oct 2011, 20:17
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: 17667
Location: In your JS exploiting you and your system
revolution
ouadji: Try using a debugger to step through and see just what byte is being skipped over.
Post 29 Oct 2011, 20:29
View user's profile Send private message Visit poster's website Reply with quote
ouadji



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

it's already done Wink
Would it be reasonable to make a comment like this without checking with a debugger?
no flags change, no registers change. For me, "mov al,[esi]" is completely useless.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 29 Oct 2011, 21:01
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: 17667
Location: In your JS exploiting you and your system
revolution
So maybe that is the point, to allow a user in a debugging session to see the upcoming value?

Anyhow, yes, it appears to be useless, but it causes no real harm. Most probably a hang over from some previous code that has since been changed. I really don't see the point of being so pedantic with the fasm code. Tomasz already stated some time back that he views it as an artistic expression in addition to the pure functional necessity.
Post 30 Oct 2011, 00:10
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji
Quote:
to allow a user in a debugging session to see the upcoming value?
Indeed, why not.
Quote:
he views it as an artistic expression in addition to the pure functional necessity.
Of course, like all programming geeks (addicted, maniac ... Wink)
Joking aside, yes, a program is also an expression of oneself and therefore an artistic expression. It's obvious.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 30 Oct 2011, 09:13
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
No, there was no artistic thought in leaving this instruction there. As revolution suspected, it's something that was left from the previous version of the code where it was actually needed, and since it does not cause any harm it was then forgotten. There are probably more things like this in fasm sources, considering how many times each part was revised during the 12 years. In fact, it would be interesting to find out if there is any piece of code that is still unchanged from 1.0.
Post 30 Oct 2011, 09:52
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


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

Website powered by rwasa.