Date: Wed, 26 Nov 1997 12:52:59 -0800 (PST) Message-Id: <199711262052.MAA16539@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: "Tan Pinghui" , From: Nate Eldredge Subject: Re: `.addrsize' and `.opsize' (was: (no subject)) Precedence: bulk At 04:52 11/25/1997 +0800, Tan Pinghui wrote: >Hello, all, > >I find the following asm listings in stub.asm: > ... > .addrsize > rep > stosd > ... > .opsize > jmpf fs:[start_eip] > ... > >Could anyone tell me the meaning of ".addrsize" and ".opsize"? They are DJASM's way of expressing the 386's confusing opcode prefix scheme. For backward compatibility with the 8086, instructions have 16-bit and 32-bit forms. But their opcodes are identical. So in a 32-bit segment the 32-bit forms are used by default, and in 16-bit segments the 16-bit forms are used by default. The prefix bytes are used to get the non-default form (i.e. a `mov ax,bx' in a 32-bit segment). `.addrsize' stands for the address size prefix byte, 0x67 if I recall correctly. This tells it to interpret the address as either a 32- or 16-bit value. For instance, it determines whether `di' or `edi' is used as the index register for a string instruction. `.opsize' is 0x66, the data size prefix byte. It determines the size of the operands, distinguishing between `mov ax,bx' and `mov eax,ebx'. In your example, I think it is being used to jump to a 32-bit address from a 16-bit segment. HTH Nate Eldredge eldredge AT ap DOT net