flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > 1.69.14 bug

Author
Thread Post new topic Reply to topic
render



Joined: 25 Jun 2010
Posts: 14
render
FASM.EXE -v
Code:
flat assembler  version 1.69.14    


bug in this code:
Code:
                        entry $
                     stdcall ff
proc ff
locals
variable dd ?
endl
            int 3
                       mov [variable],0x5
                  .while [variable] >= 0
                           mov ecx,ecx
                         sub [variable],0x2
                  .endw           
                    xor eax,eax
                 xor eax,eax
                 xor eax,eax
                 xor eax,eax
                 xor eax,eax
                 ret


endp
    

or
Code:
                   entry $
                     stdcall ff
proc ff
locals
variable dd ?
endl
            int 3
                       mov [variable],0x5
                  .while [variable] > 0
                            mov ecx,ecx
                         sub [variable],0x2
                  .endw           
                    xor eax,eax
                 xor eax,eax
                 xor eax,eax
                 xor eax,eax
                 xor eax,eax
                 ret


endp
    
Post 16 Nov 2010, 20:28
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
From documentation of Win32 programming macros on ".if"/".while" macroinstructions:
2.2 Structuring the source wrote:
The values are compared as unsigned ones.


What is not documented there is that you can actually get signed comparison if you write ".while signed [variable]>=0". It's undocumented right now, but certainly it should get covered there, so I'll add it soon.

Also note that this is related to macroinstruction package and has not much to do with fasm's executable and its version. And current version of fasm is 1.69.25, BTW.
Post 16 Nov 2010, 20:48
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.