home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.win32
- Path: sparky!uunet!microsoft!hexnut!alistair
- From: alistair@microsoft.com (Alistair Banks)
- Subject: Re: 16-bit Windows 3.1 vs Win32s thunking
- Message-ID: <1993Jan22.080936.23324@microsoft.com>
- Date: 22 Jan 93 08:09:36 GMT
- Organization: Microsoft Corporation
- References: <1993Jan21.020250.29619@emr1.emr.ca>
- Lines: 21
-
- In article <1993Jan21.020250.29619@emr1.emr.ca> jagrant@emr1.emr.ca (John Grant) writes:
- >Windows 3.1
- >-----------
- >In Windows 3.1, I can use huge pointers for large objects. Somewhere
- >in the compiled code, these are 32-bit pointers which are switched
- >back and forth between linear 32-bit addresses and segmented 16/16-bit
- >addresses as they are used in computations and for dereferencing things.
- >At least, that's my understanding of huge pointers.
-
- You're assumptions about Win32s are quite wrong, and in general about
- the operation of 32-bit code on Intel x86. The huge pointers you refer
- to are quite different from the 32-bit addressing used by Windows NT
- and Win32s+Win3.1 - the 386 in fact has 16-bit segments, and optionally
- 16-bit or 32-bit offset registers. The huge mode you refer to uses
- 16:16 addressing, while Windows NT & Win32s use 16:32 - but that would
- be 48-bit addressing, right? Well no, because we set the 16-bit
- segment registers to zero, so cs=ds=es=gs=fs=0, and we just use
- 32-bit addressing - this is a portable concept, particularly to
- RISC systems which don't have "segment" registers a la x86
-
- Hope this makes more sense now -- Alistair
-