On Tuesday, June 6, 2023 at 5:47:34 PM UTC+8,
muta...@gmail.com wrote:
> We have previously discussed laying out the PM16
> selectors. And I remember we agreed that the code
> selectors and data selectors needed to be
> intermingled to provide a somewhat flat (ie not
> really flat, more consecutive) address space.
Here is one of the discussions:
https://groups.google.com/g/alt.os.development/c/0f3Ns-Q_R4M/m/J_1X9yflAAAJ
where I said that I needed two values - a divide value
(of the amount being added) and a multiply (of how
to manipulate the segment), but that both of these
could potentially be shifts instead.
Plus I found this, not sure if it is related:
http://www.delphigroups.info/2/ae/107069.html
{ AHincr is 8 in Standard and Enhanced mode, $1000 in real mode.
AHshift is 3 in Standard and Enhanced mode, 12 in real mode (2^AHshift=AHincr) }
Regardless, it sounds to me like Microsoft found another
way to skin the cat, presumably superior to my design, and
that's what their compiler is generating (as opposed to
Watcom's flexible design where I could have implemented
my own manipulation), so there's no particular reason why
I wouldn't just copy Microsoft on this.
And since this code works on PM16 apparently, it may mean
there is an existing call (Windows 3.1 or OS/2 1.0?) to get
the AHINCR and AHSHIFT values.
And it looks to me like that AHSHIFT of 3 was designed to
manipulate selectors that contain consecutive data. I believe
we previously said that my design required intermingled
cs + ds, so the data selectors will be 0x10 apart, presumably
meaning AHSHIFT of 4 instead of 3.
Any idea if there are MSDOS or Windows or OS/2 calls to
retrieve these 2 values?
Thanks. Paul.