FIX: Incorrect RET Generated for PROC when EPILOGUE:NONE

Last reviewed: September 16, 1997
Article ID: Q102432
6.00 6.00a 6.00b 6.10 6.10a | 6.00 6.00a 6.00b
MS-DOS                      | OS/2
kbtool kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft Macro Assembler for MS-DOS, versions 6.0, 6.0a, 6.0b, 6.1, and 6.1a
  • Microsoft Macro Assembler for OS/2, versions 6.0, 6.0a, and 6.0b

SYMPTOMS

When Microsoft Macro Assembler (MASM) processes source code for an application, it may generate the incorrect form for a RET instruction in a PROC. Specifically, the assembler generates a RET 4 instruction instead of a RET instruction when the source code contains a RET instruction.

CAUSE

The source code uses the OPTION EPILOGUE statement multiple times to set the EPILOGUE macro to NONE.

RESOLUTION

Modify the source code to specify RET 0. The assembler translates this expression into a RET instruction.

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 code example demonstrates this problem:

Sample Code

; Assembler options needed: /c /Fl /Sa

.MODEL small, Pascal

_text SEGMENT

OPTION EPILOGUE:NONE p0 PROC parm1:DWORD

    ret                 ; This correctly generates a RET
p0 ENDP

OPTION EPILOGUE:EpilogueDef p1 PROC parm1:DWORD

    ret                 ; This correctly generates a RET 4
p1 ENDP

OPTION EPILOGUE:NONE p2 PROC parm1:DWORD

    ret                 ; This incorrectly generates a RET 4
p2 ENDP

_text ENDS

END


Additional reference words: 6.00 6.00a 6.00b 6.10 6.10a buglist6.00a
buglist6.00b buglist6.10 buglist6.10a fixlist6.11
KBCategory: kbtool kbfixlist kbbuglist
KBSubCategory: MLIss
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.

Last reviewed: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.