Re: NOP instruction

Bill Currie (bill@taniwha.tssc.co.nz)
Tue, 15 Dec 1998 21:34:41 +1300


Chipzz wrote:
> I've always wondered... A much used NOP "instruction" is
> OR AX,AX (or similar);

I hope it's the `or similar' due to the problem you noted below. The
`standard' NOP I know is xchg ax,ax (or eax,eax, depending), coded as
0x90.

> But doesn't this, as well as MOV DI,DI, set the zero flag???

MOV data never modifies any flag (MOV special does an undefined modify
of several), so MOV DI,DI is ok.

> As a NOP instruction is supposed to do nothing, would this then be wrong?
> (Nothing meaning not setting any flags?)

Agreed, but MOV on intel is safe.

> Hmmm... Where's the time from the good ol' Z80 when you HAD a real NOP
> instruction? *Sigh* :-)

Are you *sure* (from the hip, here)? I would not be at all surprised if
the bit encoding of the Z80's NOP was actually a special case of another
instruction. Of course, I could be wrong, I don't *remember* the 6502's
NOP being positioned where this was likely.

Bill

-- 
Leave others their otherness.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/