//A2CMMJ JOB ............................................. <== Verify //* //********************************************************************* //** * //** Copyright (c) 1995 - SAS Institute, Inc. * //** Unpublished - All Rights Reserved * //** * //** Name : A2CMMJ * //** * //** Purpose: Demonstrate assembler calling a SAS/C main via entry * //** point MAIN. The SAS/C main is loaded via the OS load * //** macro. * //** * //** Function: Compile, assemble, and lked'it source files listed * //** below. * //** * //** Source : See prefix.SAMPLE.ASM members - * //** A2CMM - C Main * //** A2CMMASM - Assembler * //** A2CMMEMG - C function used by A2CMMASM to display * //** messages * //** * //** Details : See prefix.SAMPLE.ASM(A2CMMASM) * //** * //** NOTE: Ensure the statments indicated by '<==Verify' have been * //** customized for your local environment. 'prefix' is the * //** installation defined high level qualifier for the * //** SAS/C product. * //** //********************************************************************* //** //********************************************************************* //* * //* Compile the C function that will be called from assembler to * //* display messages. INDEP is required so that upon execution a * //* C framework will be established. * //* * //********************************************************************* //* //CC EXEC LC370C,PARM.C='INDEP' //C.SYSLIN DD DSN=your.object.library(A2CMMEMG), <== Verify // DISP=OLD //C.SYSIN DD DSN=prefix.SAMPLE.ASM(A2CMMEMG), <== Verify // DISP=SHR //* //* //********************************************************************* //* * //* Assemble the assembler program that will be calling the C Main * //* program. By default assembler generates AMODE(24)/RMODE(24) * //* objects and SAS/C generates AMODE(31)/RMODE(ANY) objects. In * //* this example, the assembler must be prepared to handle a * //* 31 bit address retunred from OS LOAD for the C main. The * //* assembler module will be LKED'ed with AMODE(31)/RMODE(ANY) * //* to handle this situation. * //* * //* Options NODECK and OBJECT are to control how the assembler will * //* handle the output object deck. * //* * //* The SYSLIB DD is needed to resolove external references from * //* A2CMCEMG. * //* * //********************************************************************* //* //* //A2CMMASM EXEC hlasmcl,COND=(0,NE), <== Verify // PARM.ASM='NODECK,OBJECT', // PARM.LKED='MAP,LET,LIST', // MAC1='prefix.MACLIBA' <== Verify //ASM.SYSLIN DD DSN=your.object.library(A2CMMASM), <== Verify // DISP=OLD //ASM.SYSIN DD DSN=prefix.SAMPLE.ASM(A2CMMASM), <== Verify // DISP=SHR //LKED.SYSLMOD DD DSN=your.load.library, <== Verify // DISP=OLD //LKED.SYSLIN DD DSN=your.object.library(A2CMMASM), <== Verify // DISP=SHR //LKED.SYSLIB DD DSN=prefix.STDLIB, <== Verify // DISP=SHR // DD DSN=prefix.BASELIB, <== Verify // DISP=SHR //LKED.OBJINPT DD DSN=your.object.library, <== Verify // DISP=SHR //LKED.SYSIN DD * INCLUDE OBJINPT(A2CMMEMG) C function to print messages INCLUDE OBJINPT(A2CMMASM) Assembler program MODE RMODE(ANY),AMODE(31) Make it Compatible with C Main ENTRY ASMAIN Ensure Correct Entry Point NAME A2CMMASM(R) PDS Member Name /* //* //********************************************************************* //* * //* Compile the C Main program that will be called by entry point * //* MAIN. * //* * //********************************************************************* //* //A2CMM EXEC LC370CL,COND=(0,NE),ENTRY=NONE, // PARM.C='SNAME(A2CMM) ' //C.SYSIN DD DSN=prefix.SAMPLE.ASM(A2CMM), <== Verify // DISP=SHR //C.SYSLIN DD DSN=your.object.library(A2CMM), <== Verify // DISP=SHR //LKED.SYSLMOD DD DSN=your.load.library, <== Verify // DISP=OLD //LKED.OBJINPT DD DSN=your.object.library, <== Verify // DISP=SHR //LKED.SYSIN DD * INCLUDE OBJINPT(A2CMM) C Main ENTRY MAIN Entry Point for Parameter List ONLY NAME A2CMM(R) PDS Member Name /* //* //********************************************************************* //* * //* Execute the sample. * //* * //* Note: * //* -Output for stdout has been redirected to DD name SYSOUTM * //* in the parameter list passed to entry point MAIN * //* * //********************************************************************* //* //GO EXEC PGM=A2CMMASM,COND=(0,NE) //STEPLIB DD DSN=your.load.library, <==Verify // DISP=SHR // DD DSN=prefix.LOAD, Transient Library <==Verify // DISP=SHR //SYSOUTM DD SYSOUT=A <== stdout for MAIN //SYSTERM DD SYSOUT=A <== stderr /* //