The MASM Forum

64 bit assembler => UASM Assembler Development => Topic started by: jimg on May 31, 2017, 03:47:34 PM

Title: bug?
Post by: jimg on May 31, 2017, 03:47:34 PM
Assembling the following seems to make uasm and hjwasm crash.
.686
.model Flat, Stdcall
option Casemap :None   ; case sensitive

.data
db 1
LastBit  equ $

.code
Program:
ret
end Program


It works ok in jwasm and ml615.
Title: Re: bug?
Post by: jj2007 on May 31, 2017, 05:36:39 PM
Interesting, but:*** Assemble using \masm32\bin\Hasm32 /c /coff  tmp_file.asm ***
Hasm v2.32, May 16 2017, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

Tmp_File.asm: 12 lines, 2 passes, 0 ms, 0 warnings, 0 errors


Which version did you use? What kind of errors?
Title: Re: bug?
Post by: aw27 on May 31, 2017, 06:32:27 PM
Quote from: jimg on May 31, 2017, 03:47:34 PM
Assembling the following seems to make uasm and hjwasm crash.
.686
.model Flat, Stdcall
option Casemap :None   ; case sensitive

.data
db 1
LastBit  equ $

.code
Program:
ret
end Program


It works ok in jwasm and ml615.

Builds fine with uasm 2.34 but triggers antivirus. Runs fine after setting an exception.
Title: Re: bug?
Post by: jimg on June 01, 2017, 12:10:11 AM
crashes using version 2.34 of uasm32, test also failed with v2.16 of hjwasm, doesn't crash with uasm64-
Through process of elimination, I've narrowed it down to the -Fl option.
Compile like this:

uasm32 -c -Fl test.asm
Title: Re: bug?
Post by: jj2007 on June 01, 2017, 04:22:23 AM
Confirmed: It's /Fl, and only the 32-bit version crashes.
Title: Re: bug?
Post by: johnsa on June 02, 2017, 04:23:52 AM
Hi,

This has been fixed in 2.35 and will be available shortly.

Cheers
John
Title: Re: bug?
Post by: johnsa on June 02, 2017, 08:09:31 PM
The problem is the following piece of code in listing.c

  sprintf( &ll.buffer[idx+2], "%-" PREFFMTSTR I32_SPEC "X", sym->value );

idx = 10 in the case of LastBit  equ $ and PREFMTSTR = 25 in Jwasm up.. which causes a stack over-write as the buffer is only 32 in size. I've fixed this by reducing the size from 25 to 20.
I can see why this doesn't work, but I cannot figure why it would have ever worked in jwasm! it must have been blind luck :)

Nidud you may want to check this on your side as well?

John
Title: Re: bug?
Post by: jimg on June 02, 2017, 10:52:24 PM
Probably not the last snafu.   I just had to update an app that's been running properly for ten years, up until the last windows 10 update.  (I neglected to clear the carry flag in one place.  Apparently the windows api preceding it always returned with the carry clear until the last update.)

Any idea when it will be updated on the uasm site?  It's still showing 2.34
Title: Re: bug?
Post by: johnsa on June 02, 2017, 11:01:46 PM
I've put a pre - release out for final testing, you can grab it here so-long if you like :
http://www.terraspace.co.uk/uasm.zip (http://www.terraspace.co.uk/uasm.zip)

Just want to make sure that we've covered as many possible testing angles as possible before release as the changes were quite massive.
Title: Re: bug?
Post by: jimg on June 03, 2017, 12:05:04 AM
Thanks :biggrin:

I have another bug I'll post as a separate thread.