Previous Topic: Coding an Assembler procedure moduleNext Topic: Coding a FORTRAN procedure module


Coding a PL/I Procedure Module

The following module adds two numbers and returns the result to the main CA Culprit program.

Procedure Module

 PLIPROG:PROC(BUF,ARG1,ARG2,ARG3);
 DCL (BUF, ARG1, ARG2, ARG3) FIXED(1);
 DCL REC CHAR(80) BASED(P1);
 DCL NUMERIC1 FIXED DEC(15) BASED (P2);
 DCL NUMERIC2 FIXED DEC(15) BASED (P3);
 DCL NUMERIC3 FIXED DEC(15) BASED (P4);
 DCL (P1, P2, P3, P4) POINTER;
 DCL ADDR BUILTIN;
 P1 = ADDR(BUF);
 P2 = ADDR(ARG1);
 P3 = ADDR(ARG2);
 P4 = ADDR(ARG3);
 NUMERIC3=NUMERIC1 + NUMERIC2;
 RETURN;
 END PLIPROG;