Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ames!elroy!cit-vax!cit-vlsi!michael From: michael@cit-vlsi.Caltech.Edu (Michael Lichter) Newsgroups: comp.sys.ibm.pc Subject: Re: NOP Message-ID: <4072@cit-vax.Caltech.Edu> Date: Fri, 25-Sep-87 13:32:39 EDT Article-I.D.: cit-vax.4072 Posted: Fri Sep 25 13:32:39 1987 Date-Received: Sun, 27-Sep-87 02:48:57 EDT References: <2306@sphinx.uchicago.edu> Sender: news@cit-vax.Caltech.Edu Reply-To: michael@vlsi.caltech.edu (Michael I. Lichter) Organization: California Institute of Technology Lines: 19 Keywords: In article <2306@sphinx.uchicago.edu> cjdb@sphinx.uchicago.edu (Charles Blair) writes: > >In debugging code written in assembly-language, I notice that MASM >periodically inserts NOP's in places where they don't appear in the >source. I imagine this is done to slow down the processor, but how >does MASM "decide" the appropriate circumstances? Unlike some other assemblers that force/allow you to decide whether you want 8-bit or 16-bit relative calls and jumps, MASM decides for itself. Not being able to determine whether it can get away with the shorter instruction on the first pass, MASM reserves three bytes. If the offset is small enough, you get [instruction] [offset] [nop], and if it's not, you get [instruction] [offset] [offset]. There are other occasions when MASM will insert instructions that you might not expect, such as WAIT instructions before any co-processor instructions. Michael