Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 beta 3/9/83; site microsoft.UUCP
Path: utzoo!linus!philabs!prls!amdimage!amdcad!decwrl!decvax!tektronix!uw-beaver!microsoft!markz
From: markz@microsoft.UUCP (Mark Zbikowski)
Newsgroups: net.micro.pc
Subject: RE: REP <> REPZ
Message-ID: <8773@microsoft.UUCP>
Date: Mon, 5-Aug-85 12:52:15 EDT
Article-I.D.: microsof.8773
Posted: Mon Aug  5 12:52:15 1985
Date-Received: Sun, 11-Aug-85 03:58:52 EDT
Organization: Microsoft Corporation
Lines: 16

> From: hhoeksma@watmath.UUCP (Henry Hoeksma)
> The Lattice 2.15C that I just bought has a library function called
> movmem() that doesn't seem to work.  Programs which use it tend to
> crash randomly.  (This is for the S-model, but probably applies to
> the other models as well.)  I disassembled movmem() and discovered
> that it used the instruction REPZ MOVSB, when it should have been
> REP MOVSB.  I then wrote my own movmem() with the correct REP prefix,
> and to my surprise, when I disassembled the resulting object file
> it contained the REPZ prefix!  It seems that MASM 3.0 (from MicroSoft)
> generates the wrong opcode for the REP - namely a REPZ.
> Assembler and C programmers beware!

I believe that you misunderstand the *86 instructions.  The opcode for REP,
REPE and REPZ are identical.  The condition-testing part of this prefix only
occurs during the execution of the CMPS (compare string) and SCAS (scan string)
instructions.