14.1 Creating Assembly-Language Windows Applications

When creating an assembly-language Windows application using the Cmacros, you should do the following in your application's assembly-language source file:

1.Specify the memory model by setting one of the following options to 1: memS, memM, memC, or memL.

2.Specify the Pascal calling convention by setting the ?PLM option to 1.

This specification is required for functions that will be called by Windows.

3.Enable Windows prolog and epilog code by setting the ?WIN option to 1.

This specification is required for callback functions or for exported functions in Windows libraries.

4.Include the CMACROS.INC file in the application source file.

The statement that includes the CMACROS.INC file must come after the statements described in the preceding steps.

5.Create the application entry point, WinMain, and make sure that it is declared a public function.

6.Declare callback functions as described in Section 14.1.6, “Declaring Callback Functions.”

After assembling the application source files, link your application's assembled
object files with the appropriate C-language library for Windows and C run-time
libraries.

The rest of this section describes these steps in greater detail.