### _Pascal and _Far32_Pascal Calling Conventions in OS/2

IBM C and C++ Compilers provides both a _Pascal calling convention and a _Far32_Pascal convention. The _Far32_Pascal convention allows you to make calls between different code segments in code that runs at ring 0, and is only valid when the /Gr compiler option is specified. The _Pascal conventions are most commonly used to create virtual device drivers.

Notes:

1. These _Pascal linkage conventions should not be confused with the 16-bit _Far16_Pascal convention which is provided for 16-bit compatibility.
2. The _Far32_Pascal convention is not available in C++ programs.

The _Pascal and _Far32_Pascal conventions follow the same rules as the _System convention with these exceptions:

- Function names are converted to uppercase.
- Parameters are pushed in a left-to-right lexical order.
- The callee is responsible for cleaning up the parameters.
- Variable argument functions are not supported.
- The size of the parameter list is not passed in AL.

Important: The compiler does not convert 16-bit or 32-bit _Pascal function names to uppercase. The case of the function name in the call must match the case in the function prototype. Function names are, however, converted to uppercase in the object module to allow calls from assembler.

Calling Conventions
Develop Virtual Device Drivers

Virtual Device Driver Calling Conventions
Using _Far32_Pascal Function Pointers
Examples Using the _Pascal Convention