### Call between 32-Bit and 16-Bit Code (OS/2)

You may need to call between 32-bit and 16-bit code if:

- You have applications that depend on APIs that are only available as 16-bit code.
- You have developed or purchased libraries of routines that are currently 16-bit code.
- You need to develop a virtual device driver.

There are several ways you can work with 32-bit and 16-bit code:

- Call 16-bit code from 32-bit IBM C and C++ Compilers code
- Call back 32-bit IBM C and C++ Compilers code from 16-bit code
- Pass data between 32-bit and 16-bit code
- Share data between 32-bit and 16-bit code

The conventions and methods described apply for both C and C++ programs, except where noted otherwise. IBM C and C++ Compilers produces 32-bit code only. It does not produce 16-bit code.

Develop Virtual Device Drivers

Link 32-Bit and 16-Bit Code
Pass Data Between 32-Bit and 16-Bit Code
Declare Segmented Pointers
Declare Objects to be Shared between 16-bit and 32-bit Code

16-Bit Calling Conventions
Differences Between the 16-Bit Calling Conventions
Call Back to 32-Bit Code from 16-Bit Code
Compiler Option for 16-Bit Declarations
Restrictions on 16-Bit Calls and Callbacks
Return Values from 16-Bit Calls