Mail Archives: djgpp/2014/04/11/09:05:08
> 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 -