home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.win32
- Path: sparky!uunet!charon.amdahl.com!netcomsv!netcom.com!hill
- From: hill@netcom.com (Tom Hill)
- Subject: Re: 16-bit Windows 3.1 vs Win32s thunking
- Message-ID: <1993Jan22.193712.19398@netcom.com>
- Organization: Netcom Online Communications Services (408-241-9760 login: guest)
- References: <1993Jan21.020250.29619@emr1.emr.ca>
- Date: Fri, 22 Jan 1993 19:37:12 GMT
- Lines: 38
-
- In article <1993Jan21.020250.29619@emr1.emr.ca> jagrant@emr1.emr.ca (John Grant) writes:
- >My question focuses on the 16-bit code vs 32-bit code.
- >
- >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.
-
- I don't think it works quite the way you are thinking. in Windows 3.1
- the only translation to 32 bit flat is done inside the CPU. i.e. huge
- pointers still consist of segment:offset, and offset is still 64k. The
- compiler generates code to deal with offset overflow by checking every
- time you add to offset, and moving to the next segment (enough segments
- to cover the huge object [size/64k] are created when the object is created).
- This is much slower than 32-bit flat.
-
- >
- >Windows NT+Win32s
- >-----------------
- >So now if I have a Windows NT app, I can take it along with the Win32s
- >library to Windows 3.1 and it should run, right? Apparently the 32-bit
- >pointers are thunked down to segmented 16/16-bit pointers by the library.
- >(I hope I'm getting this more or less correct).
-
- Yes, for Win32s applications.
-
- >
- >So what's the difference?
-
- The difference is the speed at which your code can access large objects.
- If you code is more window intensive than memory intensive, you will
- be faster with native 3.1. If you use objects larger than 64k frequently
- you may be faster with win32s.
-
- Tom Hill
-