delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/20/17:14:58

From: Nate Eldredge <neldredge AT hmc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug in __dpmi_simulate_real_mode_procedure_retf_stack
Date: 20 Jan 2000 12:43:46 -0800
Organization: InterWorld Communications
Lines: 35
Message-ID: <83wvp4v5h9.fsf@mercury.st.hmc.edu>
References: <13001ab4 DOT 241463ff AT usw-ex0101-008 DOT remarq DOT com> <Pine DOT SUN DOT 3 DOT 91 DOT 1000120092708 DOT 21977T-100000 AT is>
NNTP-Posting-Host: mercury.st.hmc.edu
X-Trace: nntp1.interworld.net 948401132 7489 134.173.45.219 (20 Jan 2000 20:45:32 GMT)
X-Complaints-To: usenet AT nntp1 DOT interworld DOT net
NNTP-Posting-Date: 20 Jan 2000 20:45:32 GMT
X-Newsreader: Gnus v5.7/Emacs 20.4
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> writes:

> On Wed, 19 Jan 2000, Nigel Pattinson wrote:
> 
> > 	/* Set up %esi, %edi to copy data to the PM stack. */
> > 	subl	%ecx, %esp
> > 	movl	%esp, %edi
> > 	movl	ARG3, %esi
> > 
> > 	/* Copy the data. */
> > 	cld
> > 	rep
> > 	movsw
> > 
> > Since the size of the parameters (in ecx) is in 16-bit words, it looks
> > to me like the line
> > 
> > 	subl	%ecx, %esp
> > 
> > only reserves half the required amount of stack space.
> 
> But the copy of the data to the stack (see above) *also* uses words:
> it copies with "rep movsw".  So it moves ECX words to the stack, and
> that's exactly the amount of storage reserved there by subl.
> 
> So where exactly is the problem here?

Hmm... it is indeed copying %ecx words, but it's only reserving %ecx
*bytes*.  So it looks like it really is wrong.

Easiest fix is just to subl twice.
-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019