flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > 'fix' directive is broken in 1.67.27?

Author
Thread Post new topic Reply to topic
IceStudent



Joined: 19 Dec 2003
Posts: 60
Location: Ukraine
IceStudent 27 Aug 2008, 16:21
Hi.

Subj. Following code works in 1.67.26, but doesn't work in 1.67.27:
Code:
format binary
x fix y
display 'hi'
    
Post 27 Aug 2008, 16:21
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 27 Aug 2008, 17:30
It shows "hi" on FASMW 1.67.27, are you sure that exactly that code you posted is the one that doesn't works for you.
Post 27 Aug 2008, 17:30
View user's profile Send private message Reply with quote
IceStudent



Joined: 19 Dec 2003
Posts: 60
Location: Ukraine
IceStudent 27 Aug 2008, 17:34
LocoDelAssembly wrote:
It shows "hi" on FASMW 1.67.27

But not on fasm.exe.
Post 27 Aug 2008, 17:34
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 27 Aug 2008, 17:37
Hey you're right, pretty wierd Confused
Code:
C:\FASM>type fix-bug.asm
format binary
x fix y
display 'hi'

C:\FASM>fasm fix-bug.asm
flat assembler  version 1.67.27  (1072795 kilobytes memory)

C:\FASM>type fix-bug.asm
format binary
;x fix y
display 'hi'

C:\FASM>fasm fix-bug.asm
flat assembler  version 1.67.27  (1071963 kilobytes memory)
hi
1 passes, 0 bytes.

C:\FASM>    
Post 27 Aug 2008, 17:37
View user's profile Send private message Reply with quote
IceStudent



Joined: 19 Dec 2003
Posts: 60
Location: Ukraine
IceStudent 27 Aug 2008, 18:24
No, broken is display or, rather, add_preprocessor_symbol subroutine, because it calls get_directive without clearing a high bytes of the ECX register, so lower_case routine will clear a con_handle variable and subsequent calls to the display_block will fail.

One way to fix is here:
Code:
*** PREPROCE.INC        2008-07-09 18:38:20.000000000 +0300
--- preproce.inc 2008-08-27 21:09:34.265625000 +0300
***************
*** 487,492 ****
--- 487,493 ----
      push    edi
         mov     edx,esi
     mov     ebp,ecx
+    and     ecx,0xFF
    call    lower_case
          pop     edi
        scan_directives:
    
Post 27 Aug 2008, 18:24
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20333
Location: In your JS exploiting you and your system
revolution 27 Aug 2008, 20:01
Very nice, both a bug report and it's fix. Well done.
Post 27 Aug 2008, 20:01
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.