Converting from 16-bit to 32-bit

One of the major issues in converting from 16-bit to 32-bit arethe sizes for the predefined data types. Operating system issues are another story.

There are two schools of thought in doing the conversion. Justleave the types the same,  except for disk records, and then compile and debug.The other is to convert all data types to size specific data types. Then you getyour application running, and then you convert inefficient data types to more efficientdata types. Either approach is fine, and it cannot be determined which approach wouldtake less time.

One good rule to use is whenever possible use the normal CARDINALand INTEGER types. These are always efficient data types. For example on an IntelIA-32 processor in 32-bit mode the CARDINAL16 and INTEGER16 data types are very inefficientin generated code size and execution speed verses the CARDINAL and INTEGER types.

When you need the same source code to run 16-bit and 32-bit andyou are using the 16-bit LONGCARD type you should convert this to the CARDINAL32type. The same is true for 16-bit LONGINT, which converts to INTEGER32.

You probably will want to convert 16-bit LONGINT types to eitherINTEGER or INTEGER32 since the 32-bit LONGINT is a 64-bit integer. This same argumentapplies to the 16-bit LONGCARD type.

16-bit DOS to 32-bit DOS extended

The DOS extender makes this conversion fairly transparent. Consultthe extender documentation for details. Most of the DOS calls remain the same, usingthe same registers, with the exception that the extended register is used when passingan address to DOS. For example DS:EDX is used instead of DS:DX. The ExtUtils moduleprovides functions to access real mode memory from 32-bit protected mode. You canaccess real mode memory directly with a pointer. Consult the extender documentationabout this.

16-bit Windows to 32-bit Windows

The Win32 API was designed for ease in porting 16-bit Windowscode. The only real differences here are that pointers and handles are now 32-bit.Because of this some messages pass data differently in Win32. The Win32 SDK portingguide describes these differences.