ITS2:

CPYNV

RESULT,ARG2;

The

program

has now finished processing and ends:

RETURN: RTX

\;

 

PEND;

 

The

previous

return external (RTX) instruction is not needed because i

by

the

PEND

directive. The RTX instruction is included to add clarity

program

flow.

MI01 Program—Complete Code Example

Put all together, the program looks like this:

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\

 

\/

/\

Program Name: MIð1

\/

/\

 

\/

/\

Programming Language: MI

\/

/\

 

\/

/\

Description: Return the larger of two packed arguments.

\/

/\

 

\/

/\

 

\/

/\

Header Files Included: None

\/

/\

 

\/

/\

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

ENTRY \ (PARM_LIST)

EXT;

 

 

DCL

SPCPTR

ARG1@

PARM;

 

DCL

SPCPTR

ARG2@

PARM;

 

DCL

SPCPTR

RESULT@

PARM;

 

DCL

OL

PARM_LIST

 

 

 

 

(ARG1@,

 

 

 

 

ARG2@,

 

 

 

 

RESULT@)

 

 

 

 

PARM

EXT;

 

DCL

DD

ARG1

PKD(15,5)

BAS(ARG1@);

DCL

DD

ARG2

PKD(15,5)

BAS(ARG2@);

DCL

DD

RESULT

PKD(15,5)

BAS(RESULT@);

 

CMPNV(B)

ARG1,ARG2

/ LO(ITS2);

 

 

CPYNV

RESULT,ARG1;

 

 

B

RETURN;

 

 

ITS2:

CPYNV

RESULT,ARG2;

 

RETURN: RTX

\;

 

 

 

PEND;

 

 

 

Compiling a Program

If

you

enter

the

source

into a

source

physical

file,

you

can

now

c

and create an MI program. To create

the program, use the Create Prog

(QPRCRTPG)

API documented in theSystem API

Reference.

 

 

 

 

 

 

Note:

The

QPRCRTPG

API

assumes

that

the

source statements

presented

to

 

 

are in code page 37. See the

introductionMachine Interfaceto the

Func-

 

 

 

tional Referencefor the

specific code

points

required

to

build

MI

7-4System API Programming V4R1

Page 144
Image 144
IBM Version 4 manual Compiling a Program, MI01 Program-Complete Code Example