//A2CMOJ JOB .......................................... <== Verify //* //** * //** Copyright (c) 1995 - SAS Institute, Inc. * //** Unpublished - All Rights Reserved * //** * //** Name : A2CMOJ * //** * //** 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 - * //** A2CMO - C Main * //** A2CMOASM - Assembler * //** * //** Details : See prefix.SAMPLE.ASM(A2CMOASM) * //** * //** 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(A2CMOEMG), <== Verify // DISP=OLD //C.SYSIN DD DSN=prefix.SAMPLE.ASM(A2CMOEMG), <== 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 situtation. * //* * //* 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. * //* * //********************************************************************* //* //A2CMOASM EXEC hlasmcl,COND=(0,NE), <== Verify // PARM.ASM='NODECK,OBJECT', // PARM.LKED='MAP,LET,LIST' //ASM.SYSLIN DD DSN=your.object.library(A2CMOASM), <== Verify // DISP=OLD //ASM.SYSIN DD DSN=prefix.SAMPLE.ASM(A2CMOASM), <== Verify // DISP=SHR //LKED.SYSLMOD DD DSN=your.load.library, <== Verify // DISP=OLD //LKED.SYSLIN DD DSN=your.object.library(A2CMOASM), <== 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(A2CMOEMG) C function to display messages INCLUDE OBJINPT(A2CMOASM) Assembler program MODE RMODE(ANY),AMODE(31) Make it compatible with C main ENTRY ASMAIN Ensure Correct Entry Point NAME A2CMOASM(R) PDS Member Name /* //* //********************************************************************* //* * //* Compile the C Main program that will be called by entry point * //* MAIN. * //* * //********************************************************************* //* //A2CMO EXEC LC370CL,COND=(0,NE),ENTRY=NONE, // PARM.C='SNAME(A2CMO) ' //C.SYSIN DD DSN=prefix.SAMPLE.ASM(A2CMO), <== Verify // DISP=SHR //C.SYSLIN DD DSN=your.object.library(A2CMO), <== 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(A2CMO) C Main ENTRY $MAINO Entry Point With Options&Arguments NAME A2CMO(R) PDS Member Name /* //* //********************************************************************* //* * //* Execute the sample. * //* * //* Note: * //* -Output has been redirected to SYSOUTO via the parameter * //* list passed to entry point $MAINO. * //* * //********************************************************************* //* //GO EXEC PGM=A2CMOASM,COND=(0,NE) //STEPLIB DD DSN=your.load.library, <==Verify // DISP=SHR // DD DSN=prefix.LOAD, Transient Library <==Verify // DISP=SHR //SYSOUTO DD SYSOUT=A <== stdout for $MAINO //SYSTERM DD SYSOUT=A <== stderr /* //