KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q83087: FIX: MASM Moves Segment Register w/out Generating Error

Article: Q83087
Product(s): Microsoft Macro Assembler
Version(s): 6.0,6.0a,6.0b,6.1,6.1a
Operating System(s): 
Keyword(s): 
Last Modified: 06-MAY-2001

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Macro Assembler (MASM), versions 6.0, 6.0a, 6.0b, 6.1, 6.1a 
-------------------------------------------------------------------------------

SYMPTOMS
========

Microsoft Macro Assembler (MASM) may move a segment register instead of
generating an error on an invalid code statement. In the following example, the
statement:

     mov bx, es[1234h]

should generate an error. However, MASM treats the statement as:

     mov bx, es

and thus does not generate the code that may be expected. The code that the user
anticipated being generated was:

     mov bx, es:[1234h]

STATUS
======

Microsoft has confirmed this to be a problem in MASM versions 6.0, 6.0a, 6.0b,
6.1, and 6.1a. This problem was corrected in MASM for MS-DOS version 6.11.

MORE INFORMATION
================

The following program should generate two assembler errors but does not:

Sample Code
-----------

  ; Assemble options needed: none

  .MODEL small
  .386
  .STACK 4096

  .CODE
  start:
     mov bx,es[1234h]     ; This should generate an error.
     mov es[1234h],bx     ; This should generate an error.
     mov ax, 4C00h
     int 21h
  END start

Additional query words: 6.00 6.00a 6.00b 6.10 6.10a buglist6.00a buglist6.00b buglist6.10 buglist6.10a fixlist6.11

======================================================================
Keywords          :  
Technology        : kbMASMsearch kbAudDeveloper kbMASM600 kbMASM610 kbMASM610a kbMASM600a kbMASM600b
Version           : :6.0,6.0a,6.0b,6.1,6.1a
Solution Type     : kbfix

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.