flat assembler
Message board for the users of flat assembler.

Index > IDE Development > fasm.inc

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 26 Dec 2010, 21:51

I noticed this little thing
sorry i'm crazy about optimization Smile

A) and B)
bit eax,31 is always = 0
I think that "and eax,7FFFFFFFh" is useless.
(because " test byte [edx+7],80h")

Code:
      get_error_lines:
        mov     eax,[ebx]
   cmp     byte [eax],0
        je      get_next_error_line
 test    byte [ebx+7],80h   ;<===
 jz      error_lines_ok
      inc     ecx
 mov     edx,ebx
      find_definition_origin:
        mov     edx,[edx+12]
        test    byte [edx+7],80h   ;<===
 jnz     find_definition_origin
      mov     eax,[edx+4]
 and     eax,7FFFFFFFh   ;<--- A) useless
     push    eax
 mov     edx,[edx]
   push    edx
      get_next_error_line:
       mov     ebx,[ebx+8]
 jmp     get_error_lines
      error_lines_ok:
        inc     ecx
 mov     eax,[ebx+4]
 and     eax,7FFFFFFFh   ;<--- B) useless
     push    eax
 mov     edx,[ebx]
   push    edx
 mov     ebx,ecx
     inc     ecx
 shl     ecx,3

    

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 26 Dec 2010, 21:51
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: 20445
Location: In your JS exploiting you and your system
revolution 27 Dec 2010, 09:40
I think more important would be to give names to all the magic constants.
Post 27 Dec 2010, 09:40
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 27 Dec 2010, 10:16
revolution wrote:
I think more important would be to give names to all the magic constants.


Or even more: add some comments revealing what register holds what Shocked
Post 27 Dec 2010, 10:16
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 27 Dec 2010, 11:55
Quote:
Or even more: add some comments revealing what register holds what
Trace sources, again and again, go there for hours,
and you understand why and how about all.
A magic word : int3


_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 27 Dec 2010, 11:55
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.