PRB: Error A2068 Using REP Prefix with CMPS InstructionsLast reviewed: January 9, 1995Article ID: Q120155 |
The information in this article applies to:
SYMPTOMSAssembling a line of code that uses the REP instruction prefix with one of the string-compare instructions, such as
REP CMPSBproduces the following error message:
error A2068: instruction prefix not allowedThe same line of code assembles without error under MASM version 5.1.
CAUSEWith MASM version 5.1, as well as when using MASM version 6.x with OPTION M510, the REP CMPSB instruction is encoded as a REPE CMPSB. NOTE: The difference between these instructions is that the REP instruction repeats CX times regardless of the zero flag (ZF); however, the REPE and REPNE instructions check the ZF flag as they repeat. Because there is virtually no encoding for REP CMPSB, MASM versions 6.0 and 6.1 generate an error message.
RESOLUTIONAssemble using the OPTION M510 directive, or use the REPE instruction prefix.
MORE INFORMATIONThe following are legal forms of the string-compare instruction:
CMPSB ; compare string byte CMPSW ; compare string word CMPSD ; compare string doubleword |
Additional reference words: 6.00 6.00a 6.00b 6.10 6.10a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |