News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

macro for division by a constant (magic division)

Started by qWord, October 02, 2009, 02:11:19 AM

Previous topic - Next topic

qWord

Quote from: Biterider on March 12, 2012, 01:49:50 PMWhat was the problem? Is it really a jWasm bug?
yes.
jWasm and MASM are internally using signed 64 Bit constants (probably __int64/long long). Only the low DWORD is returned when expanding/replacing a constant - jwasm seems to place the whole 64Bit value, which can be used further, because jWasm's (and MASM's) expression evaluator does not accept 64 Bit values. To allow working/calculating with 64Bit constants, the LOW/HIGH32 operator were introduced with ML v8. This operators allows explicit access the low and the high DWORD, thus 64Bit (signed) calculations are possible. Also the behaviour of SHR has changed: in version 6-7, the high bits were masked out, in newer versions the upper bits are shifted in the low DWORD.
FPU in a trice: SmplMath
It's that simple!

Biterider

Hi qWord
I think the bug should be reported.
Who will do it? I think you are in a better position to explain the problem...

Regards, Biterider

qWord

FPU in a trice: SmplMath
It's that simple!