Chapter 8 Sharing Data and Procedures among Modules and Libraries

To use symbols and procedures in more than one module, the assembler must be able to recognize the shared data as global to all the modules where they are used. MASM 6.0 provides new techniques to simplify data-sharing and give a high-level interface to multiple-module programming. With these techniques, you can place shared symbols in include files. This makes the data declarations in the file available to all modules that use the include file.

After an overview of the data-sharing methods, the next section of this chapter focuses on organizing modules and using the include file to simplify data-sharing. The first method allows you to create a single include file that works in the modules where the symbol is used as well as where it is defined.

Sharing procedures and data items using the PUBLIC and EXTERN directives in the appropriate modules is the other method of data-sharing. The third section of this chapter explains how to use PUBLIC and EXTERN.

You may also want to place commonly used routines in libraries. Section 8.4 explains how to create program libraries and access their routines.