From: Vik Heyndrickx Newsgroups: comp.os.msdos.djgpp Subject: Re: 16-bit & 32-bit mixed coding Date: Wed, 03 Dec 1997 10:28:05 +0100 Organization: University of Ghent, Belgium Lines: 23 Message-ID: <34852625.352E@rug.ac.be> References: <199712030351 DOT LAA10373 AT public DOT bta DOT net DOT cn> NNTP-Posting-Host: eduserv1.rug.ac.be Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Tan Pinghui wrote: > Sorry, my previous mail (and this one) is off topic, it's not related to > DJGPP. ... meaning that you were better off posting to another ng. > The code segment is 32-bit, if I set the stack segment to 16-bit and do a > "push 0x1000", is the stack pointer SS:ESP or SS:SP? is the value I pushed > the word 0x1000 or the double word 0x00001000? When SS is 16-bit (B-bit reset) the CPU always uses SP for instructions implicitely addressing the stack. Whether the value you pushed is 16 or 32 bits depends on the addressing mode, which equals to the D-bit from the current segment (CS) xor'ed with the presence of the operand size prefix. Assuming you mean without an ads prfx, 0x00001000 is pushed. This also means that this value is (or must be) encoded within the instruction as 4 bytes rather than 2. -- \ Vik /-_-_-_-_-_-_/ \___/ Heyndrickx / \ /-_-_-_-_-_-_/