SAMPLE: Writing a Windows Application Using MASM 6.0Last reviewed: February 15, 1996Article ID: Q77256 |
The information in this article applies to:
SUMMARYUsing the high-level language features of the Microsoft Macro Assembler (MASM) version 6.0, it is now much simpler to write a complete Windows program in MASM than with previous versions of the program. A program called MASMWIN in the Microsoft Software Library demonstrates what is required to write a complete Windows program using MASM 6.0. Download MASMWIN.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
While MASM provides a complete programming environment with high-level language features, applications written in MASM will be much more difficult to transfer to future versions of Windows that run on non- Intel platforms.
MORE INFORMATIONUsing the OPTION:PROLOGUE and OPTION:EPILOGUE directives in MASM 6.0, an application can cause MASM 6.0 to generate any type of prologue or epilogue code desired. For this program, it creates the appropriate Windows code. The macros to perform this task are contained in the file WINPRO.INC. The two declarations, ?WINDOWS=1 and ?PMODE=1, affect the generation of the prologue and epilogue code. The ?WINDOWS=1 declaration will cause Windows prologue and epilogue code to be generated for all FAR functions. All other functions are declared with the normal function stack frame. The ?PMODE=1 declaration causes the Windows prologue and epilogue code to be generated only for FAR functions declared as EXPORT. This code takes advantage of the fact that in protected mode, Windows does not walk the stack. The program includes a WINDOWS.INC file that is different from the one included in Windows Software Development Kit (SDK) version 3.0. This WINDOWS.INC file was created by running WINDOWS.H through the H2INC utility provided with MASM 6.0. This provides prototypes for all of the Windows functions and also translates C structures to corresponding MASM structures. This file allows the INVOKE feature of MASM 6.0 to be used to call Windows functions. The INVOKE function handles all the parameter passing and stack clean up. To use this file, it is necessary to include the following line in the source code before the line that includes the new WINDOWS.INC:
OPTION CASEMAP:NONEThis causes the assembler to maintain case sensitivity when dealing with symbols.
|
Additional reference words: 3.00 3.10 softlib MASMWIN.EXE
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |