MASM Fails to Generate Error When Real Values Are Too Small

ID Number: Q72791

5.10 5.10a 6.00 | 5.10 5.10a 6.00

MS-DOS | OS/2

buglist5.10 buglist5.10a buglist6.00

Summary:

The Microsoft Macro Assembler (MASM) versions 5.1, 5.1a, and 6.0 may

fail to generate an error when a floating-point value is outside the

range of the minimum allowable values.

More Information:

As documented on page 142 of the "Microsoft Macro Assembler

Programmer's Guide" included with version 6.0, the limits when using

the 4-byte REAL4 (or DD), 8-byte REAL8 (or DQ), or the 10-byte REAL10

(or DT) are as follows:

Size Low High

---- --- ----

4 byte 1.18E-38 3.40E+38

8 byte 2.23E-308 1.79E+308

10 byte 3.37E-4932 1.18E+4932

However, MASM versions 5.1, 5.1a, and 6.0 fail to generate an error

when exceeding the low end of this range until a value of 3.37E-32752

or smaller for the 4- and 8-byte types and a value of 3.37E-32746

or smaller for the 10-byte type.

More Information:

The sample program below may be used to illustrate this problem. In

the code, two of each of the 4-, 8-, and 10-byte data types are

declared and initialized. For each type, one initializing value is

used that correctly causes an error, while the other similar

initializing value fails to cause an error, even though it should.

The declaration of n1, n3, and n5 correctly result in the following

error in MASM version 6.0:

error A2071: initializer magnitude too large for specified size

MASM versions 5.1 and 5.1a are not as explicit in their error message,

but they correctly generate the following overflow error for n1, n3,

and n5:

error A2029: division by 0 or overflow

Neither MASM version 5.1, 5.1a, or 6.0 generates an error (as they

should) on the declaration of n2, n4, and n6. (These versions fail to

produce the expected error for any number smaller than the values

listed above for each data type.)

Microsoft has confirmed this to be a problem in MASM versions 5.1,

5.1a, and 6.0. We are researching this problem and will post new

information here as it becomes available.

Sample Code

-----------

; Assemble options needed: none

.MODEL LARGE

.STACK 10h

.DATA

n1 DD 1.18E-32752 ;Causes error

n2 DD 1.18E-32751 ;Should cause error, but doesn't

n3 DQ 2.23E-32752 ;Causes error

n4 DQ 2.23E-32751 ;Should cause error, but doesn't

n5 DT 3.37E-32746 ;Causes error

n6 DT 3.37E-32745 ;Should cause error, but doesn't

.CODE

start:

mov ah,4ch

int 21h

end start