FIX: JMP Jumps to the Proc When Using Duplicate NamesLast reviewed: September 16, 1997Article ID: Q76911 |
6.00 6.00a 6.00b | 6.00 6.00a 6.00b
MS-DOS | OS/2kbtool kbfixlist kbbuglist The information in this article applies to:
SYMPTOMSUsing the Microsoft Macro Assembler (MASM) versions 6.0, 6.0a or 6.0b, the JMP instruction will jump to the procedure name rather than a local label if the names of the procedure and the local label are identical. After the jump, the procedure begins running rather than the code at the label.
RESOLUTIONTo work around the problem, create a local label with a name that is different from the procedure name.
STATUSMicrosoft has confirmed this to be a problem in MASM versions 6.0, 6.0a, and 6.0b. This problem was corrected in MASM for MS-DOS version 6.1.
MORE INFORMATIONThe sample code below does not generate a syntax error for the identical procedure name and label name because the label is local to the procedure it is defined in. If the label is defined with a double colon (::) instead of a single colon (:), it becomes a global label and causes the assembler to generate an error. The assembler should generate code that jumps to the local label rather than the procedure.
Sample Code; Assemble options needed: none .MODEL small .STACK 4096 .DATA .CODE .startup call myproc .exit 0myproc PROC jmp SHORT mylabelmylabel: ret ; Should execute thismyproc ENDP mylabel PROC ret ; Shouldn't execute thismylabel ENDP END
|
Additional reference words: 6.00 6.00a 6.00b buglist6.00 buglist6.00a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |