Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!princeton!udel!rochester!bbn!husc6!mit-eddie!ll-xn!ames!lll-tis!ptsfa!amdahl!bnrmtv!perkins From: perkins@bnrmtv.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: NOP Message-ID: <2660@bnrmtv.UUCP> Date: Wed, 30-Sep-87 15:40:37 EDT Article-I.D.: bnrmtv.2660 Posted: Wed Sep 30 15:40:37 1987 Date-Received: Sat, 3-Oct-87 04:42:06 EDT References: <2306@sphinx.uchicago.edu> <4478@amd.AMD.COM> <309@ncrcan.UUCP> Organization: BNR Inc., Mountain View, California Lines: 38 Keywords: NOP, nonsense Summary: The NOP after a short jump isn't executed. In article <309@ncrcan.UUCP>, brian@ncrcan.UUCP (Brian Onn) writes: > In article <4478@amd.AMD.COM> ching@amd.UUCP (Mike Ching) writes: > >.... The NOPs are never executed and don't slow down the > >processor. > > > >mike ching > > Sorry, but the NOPS are always executed (how would the processor know that > it is in fact a NOP, if it didn't execute it) and each execution takes > a finite, albeit minimal amount of execution time. Here's the original text that Brian abridged: More likely that these NOPs follow forward branches. MASM leaves space for a 3-byte jump instruction during its first pass and fills the third byte with a NOP if a two byte instruction is all that is necessary. The NOPs are never executed and don't slow down the processor. mike ching The short jump transfers execution to some instruction other than the NOP; the NOP is NEVER executed. The processor DOESN'T "know" that it's a NOP; it never has a chance to execute it (although it does put it in its prefetch queue). Execution of a NOP takes a finite but NON-minimal amount of time; a NOP (same as XCHG AX,AX) takes 3 bus cycles, whereas the minimum for an instruction is 2 bus cycles (example: CLD, which I generally use in preference to NOP because I keep the direction flag cleared anyway). Sorry, Brian, but I think that's a first: a one-sentence posting with THREE errors. Better luck next time, and for now I recommend "The 8086 Book" by Rector & Alexy (Osborne/McGraw-Hill Books). -- {hplabs,amdahl,ames}!bnrmtv!perkins --Henry Perkins It is better never to have been born. But who among us has such luck? One in a million, perhaps.