delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2014/04/11/09:05:08

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Date: Fri, 11 Apr 2014 16:04:47 +0300
From: Eli Zaretskii <eliz AT gnu DOT org>
Subject: Re: Is this a bug in crt1.c?
In-reply-to: <op.xd5etwkg6zenlw@localhost>
X-012-Sender: halo1 AT inter DOT net DOT il
To: djgpp AT delorie DOT com
Message-id: <83r454t3tc.fsf@gnu.org>
References: <op DOT xd4ntjft6zenlw AT localhost> <201404110126 DOT s3B1Q0R8020183 AT delorie DOT com> <op DOT xd44buvg6zenlw AT localhost> <83y4zctgrr DOT fsf AT gnu DOT org> <op DOT xd5etwkg6zenlw AT localhost>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Rod Pemberton" <dont_use_email AT xnothavet DOT cqm>
> Date: Fri, 11 Apr 2014 06:45:22 -0400
> 
> > Therefore, env_selector is suitable to be the 1st arg of movedata.
> 
> Sigh, that is exactly what I asked about.
> This is also where you've lost me.

And you have now lost me.  What exactly is the problem, in detail?

movedata needs a PM selector that will work with the corresponding
offset.  The value of env_selector is such a selector, because its
value originated from the program's PSP, which was converted as DJ
described.  Specifically, this part of the docs:

  The environment pointer in the client program's PSP is automatically
  converted to a selector during the mode switch.

should tell you that the value at offset 0x2C in the memory block
pointed to by the psp_selector is a PM selector for the environment,
so copying its value to env_selector and using it in another call to
movedata is correct.

> I'm not going to ask you two for the other *HALF* of the question.

Which is what, exactly?  Sorry, my crystal ball seems to be cloudy
this afternoon.  But if you explain what other half is still unclear,
somebody might be able to clarify that.

Your questions were:

> Is there a hidden conversion from RM segment to PM selector somewhere?

Answered by DJ.

> Is there code somewhere else which convert the value within the PSP to
> a selector?

Answered by the docs pointed to by DJ.

> Or, does movedata() convert segments to selectors?

No, it does not.

> AIUI, movedata() only works with selectors.

Correct.

> What have I missed here?

Is this the other half of the question?  If so, I think it is
automagically answered by the two answers above.

- Raw text -


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