This will crash in recent releases of MASM. Builds fine in MASM 6.xxx
SDWORD appears to be the culprit
.686
.MODEL FLAT, STDCALL
.data
myVar SDWORD ?
.code
main PROC
int 3 ; <- Remove to run on the command line
mov eax, 3
.IF SDWORD PTR eax > 0
.IF eax==3
lea eax, [eax+2*eax]
mov ecx, 3
mov SDWORD PTR myVar, ecx
.ENDIF
.ENDIF
ret
main ENDP
END main
or this:
.686
.MODEL FLAT, STDCALL
.data
myVar SDWORD ?
.code
main PROC
int 3 ; <- Remove to run on the command line
mov myVar, 3
.IF SDWORD PTR myVar > 0
.IF myVar==3
lea eax, [eax+2*eax]
mov ecx, 3
mov SDWORD PTR myVar, ecx
.ENDIF
.ENDIF
ret
main ENDP
END main
deleted
Looks similar to the MASM 14.0 .if signed comparison bug (http://masm32.com/board/index.php?topic=6447.0) thread.
The SDWORD ptr doesn't work e.g. in ML 14 and 15, the jmp is one byte off. It works fine in ML 6.14 ... 10.0, though. It seems M$ has recently lost control over their pile of s**t.
Workaround:
mov SDWORD PTR myVar, ecx
nop
Rumours say there is also a perfect clone for ML that handles all recent opcodes perfectly, is three times faster and absolutely bug-free, at least compared to recent M$ assemblers 8)
I was not aware of the need for the nop :(
So, now everybody knows that the bug is still on the latest and greatest:
Microsoft (R) Macro Assembler Version 14.11.25547.0
Copyright (C) Microsoft Corporation. All rights reserved.
deleted
Quote from: aw27 on December 04, 2017, 02:15:27 AM
I was not aware of the need for the nop :(
Contact Hyde, Irvine, Kusswurm and Iczelion - they must update their books and tutorials 8)
(hint: UAsm works without the magic
nop (http://www.terraspace.co.uk/uasm.html))
deleted
Quote from: nidud on December 04, 2017, 02:57:09 AM
Re: MASM 14.0 .if signed comparison bug
Quote from: aw27 on August 06, 2017, 03:08:43 PM
Quote from: Queue on August 05, 2017, 08:19:07 PM
Quote from: LiaoMi on August 05, 2017, 06:03:40 PM
did you report this discovery to Microsoft?
No, I haven't. I don't even know where I could report this sort of information to Microsoft.
You can try https://connect.microsoft.com/VisualStudio/
LOL :icon_eek:
And the case of the mysterious disappearance of "dec ebx" (yes, NOP shall fix).
.686
.MODEL FLAT, STDCALL
.data
myValue SDWORD 10
.code
main PROC
int 3 ; <- Remove to run on the command line
mov edx, 3
mov ebx, edx
.WHILE ebx>0
.WHILE ecx<myValue
inc ecx
.ENDW
dec ebx ; <-- will disappear
.ENDW
ret
main ENDP
END main
Quote from: aw27 on December 04, 2017, 03:21:57 AMAnd the case of the mysterious disappearance of "dec ebx" (yes, NOP shall fix).
We shouldn't be too critical, José. At least, with the extra nop, this is one of the last Micros**t assemblers who understand the .While ... .Endw syntax :t
Quote from: jj2007 on December 04, 2017, 03:28:29 AM
Quote from: aw27 on December 04, 2017, 03:21:57 AMAnd the case of the mysterious disappearance of "dec ebx" (yes, NOP shall fix).
We shouldn't be too critical, José. At least, with the extra nop, this is one of the last Micros**t assemblers who understand the .While ... .Endw syntax :t
Let's enjoy it while it lasts then. :biggrin:
:biggrin:
Real Men[tm] code in mnemonics, if you need lots of high level hand holding, try a visual garbage generator. :P
Quote from: hutch-- on December 04, 2017, 09:47:55 AMReal Men[tm] code in mnemonics
Quote from: aw27 on December 04, 2017, 03:21:57 AM
dec ebx ; <-- will disappear
The dec ebx
is a mnemonic. For recent MASM versions, you need to resort to the level below mnemonics:
db 4bh ; dec ebx
For Real Men
TM, the db nnn notation should be made obligatory 8)
Quote from: jj2007 on December 04, 2017, 10:29:30 AM
For Real MenTM, the db nnn notation should be made obligatory 8)
You have tried to say "Real Crazy Men
TM"? :biggrin: