MSM9201002: MASM 6.0 May Generate Wrong Listing for CMPXCHG

ID Number: Q79835

6.00 6.00a | 6.00 6.00a

MS-DOS | OS/2

buglist6.00 buglist6.00a

Summary:

PROBLEM ID: MSM9201002

SYMPTOMS

When using the Microsoft Macro Assembler (MASM) versions 6.0 and

6.0a to generate a listing file for an assembler source file that

contains a CMPXCHG instruction, errors may occur in that listing. A

colon is appended to bytes of values 26h, 2Eh, 36h, and 3Eh when

they appear in an instruction. For example, the following are

generated:

0000 0F B0 26: 00 00 CMPXCHG data1, ah

0005 0F B0 2E: 00 00 CMPXCHG data1, ch

000A 0F B0 36: 00 00 CMPXCHG data1, dh

000F 0F B0 3E: 00 00 CMPXCHG data1, bh

instead of the following:

0000 0F B0 26 0000 R CMPXCHG data1, ah

0005 0F B0 2E 0000 R CMPXCHG data1, ch

000A 0F B0 36 0000 R CMPXCHG data1, dh

000F 0F B0 3E 0000 R CMPXCHG data1, bh

In addition, the address of a memory location is not always shown;

instead, a series of disjoint zero bytes appear. For example, the

following is generated

0014 0F B0 16 00 00 CMPXCHG data2, dl

instead of the following:

0014 0F B0 16 0100 R CMPXCHG data2, dl

Note that this also occurs in the first example. Finally, extra

trailing bytes may be placed in the listing file. For example, the

following is generated

0019 67& 0F B1 94 73 00000200 R CMPXCHG data3[ebx+2*esi],dx

00 00 00 09

Instead of the following:

0019 67& 0F B1 94 73 00000200 R CMPXCHG data3[ebx+2*esi],dx

STATUS

Microsoft has confirmed this to be a problem in MASM versions 6.0

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

information here as it becomes available.

More Information:

Sample Code

-----------

; Assemble options needed: /Fl

.MODEL small

.486

.DATA

data1 DB 100h DUP ('x')

data2 DB 100h DUP ('y')

data3 DW 100h DUP (1)

.CODE

start:

CMPXCHG data1, ah

CMPXCHG data1, ch

CMPXCHG data1, dh

CMPXCHG data1, bh

CMPXCHG data2, dl

CMPXCHG data3[ebx+2*esi],dx

END start

Additional reference words: 6.00