For an example of baseless code generation macros, check out the zcobol compiler which installs in z390\zcobol directory as part of z390 install. The procedure division code generated uses baseless code for all branching. For instructions that require base and displacement, a set of lower level code generation macros keep track of which data access base reqisters have been set to what work-storage offset, and if a new data access base register is required the oldest is canceled and a new base is set via LARL. This example is a special case in that the zcobol compiler uses macros to define all the working storage data fields including their relative offset which is then available to base macros. However, it may still server as a useful example.
All the general COBOL macros are in z390\zcobol and all the z390 HLASM compatible code generation macros are in z390\zcobol\z390. All the code is open source. For downloads and more information visit www.z390.org and www.zcobol.org. Don Higgins [email protected]
