Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Macro Cross Reference

IP.com Disclosure Number: IPCOM000089166D
Original Publication Date: 1977-Sep-01
Included in the Prior Art Database: 2005-Mar-04
Document File: 3 page(s) / 46K

Publishing Venue

IBM

Related People

Nash, SC: AUTHOR

Abstract

A method of producing a macro cross-reference listing for a multimodule assembler program is described. For each macro or copybook used, the modules in which it is used are listed, together with the number of uses in each module. Only macro calls and COPY statements actually executed at assembly time are counted as uses. All such uses are counted, including those nested within other macros or copybooks and those which do not cause any statements to be generated in the assembly listing. This method was originally devised as a means of producing a macro cross-reference listing for the PL/1 Optimizing Compiler.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 3

Macro Cross Reference

A method of producing a macro cross-reference listing for a multimodule assembler program is described. For each macro or copybook used, the modules in which it is used are listed, together with the number of uses in each module. Only macro calls and COPY statements actually executed at assembly time are counted as uses. All such uses are counted, including those nested within other macros or copybooks and those which do not cause any statements to be generated in the assembly listing. This method was originally devised as a means of producing a macro cross-reference listing for the PL/1 Optimizing Compiler.

Two approaches to the method of collecting data on which macros and copybooks are used have been used in the past. The first is to scan the assembly listings. However, this does not allow properly for macros nested within other macros. The second is to scan the source modules (and possibly the macros as well to allow for nested macro invocations). This does not allow for conditional assembly logic and so may mean that macros are listed which are not in fact used.

The described method uses an assembly to collect the macro usage data. The data is output from the assembly by means of extra macro usage records (generated by PUNCH statements) in the object module. The object module is then processed to extract the macro usage records and to put the macro usage data for that module onto a master data set.

The macro usage data is collected by modifying the macro library to introduce a global SET symbol for each macro, which is incremented by 1 each time that macro is invoked. An OPSYN assembler instruction is inserted at the start of the assembler SYSIN input to turn the module END statement into a macro invocation. The END macro tests all the macro usage count global SET symbols and for each that is nonzero generates a PUNCH statement to put out a record in the object module indicating the number of uses of the corresponding macro.

Notes on the diagram which illustrates the method of processing.
1. Modifying the macro library and creating the END macro are done automatically by programs.
2. The two lines

END OPSYN

SCNEND OPSYN END. are concatenated before the module in the assembler SYSIN input. This causes the END statement of the module to become an invocatio...