Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Example with an Assembler main program

&pagelevel(3)&pagelevel

PERCON is to be called as a subprogram by an Assembler main program. The statements are read from SYSDTA.

Source listing
PERUP    START
PERUP    AMODE ANY
PERUP    RMODE ANY
         BALR  8,0
         USING *,8
         LA    1,ATAB                  ADR. PARAMETERLEISTE ———————————  (1)
         LA    13,SAV                  ADR. SICHERSTELLUNGSBEREICH ————  (2)
         L     15,=V(PERCONU) —————————————————————————————————————————  (3)
         BALR  14,15                   UNTERPROGRAMMSPRUNG ————————————  (4)
         TERM
         SPACE 3
SAV      DS    20F                     SICHERSTELLUNGSBEREICH —————————  (5)
         SPACE
ATAB     DC    A(PARAM)                PARAMETERLEISTE ————————————————  (6)
         DC    A(RETCODE) —————————————————————————————————————————————  (7)
         DC    X'80000000' ————————————————————————————————————————————  (8)
         SPACE
RETCODE  DC    F'0' ———————————————————————————————————————————————————  (9)
         DC    12X'00' ———————————————————————————————————————————————— (10)
         SPACE
PARAM    DC    X'00000080'             ANWEISUNGEN VON SYSDTA ————————— (11)
         END   PERUP 

(1)

Register 1 is loaded with the symbolic address ATAB of the address list.

(2)

Register 13 is loaded with the symbolic address SAV of the save area.

(3)

Register 15 is loaded with a V-type constant specifying the address of the entry point PERCONU.

(4)

Branch to the subprogram; register 14 is loaded with the return address.

(5)

20 words are reserved for the save area.

Definition of the address list:

(6)

Address constant PARAM indicating the parameter area

(7)

Address constant RETCODE indicating the area for return information

(8)

End criterion for the address list

Area for return information:

(9)

This area is reserved for the message code of the last DMS message issued.

(10)

All PERCON messages from the range PER0000 thru PER0095 issued during program execution are registered in this area.

(11)

Parameter area, byte 4 contains X’00’; this means that the statements are read from SYSDTA in SDF format.

Compiling, linking and calling the program (tracer listing)

/DELETE-SYSTEM-FILE FILE-NAME=*OMF
/START-ASSEMBH
%  ASS6010 V01.4A10 OF BS2000 ASSEMBH  READY
//COMPILE SOURCE=ASS.TEST,MACRO-LIBRARY=$.MACROLIB
%  ASS6011 ASSEMBLY TIME: 21 MSEC
%  ASS6018 0 FLAGS, 0 PRIVILEGED FLAGS, 0 MNOTES
%  ASS6019 HIGHEST ERROR-WEIGHT: NO ERRORS
%  ASS6006 LISTING GENERATOR TIME: 5 MSEC
//END
%  ASS6012 END OF ASSEMBH
/START-BINDER
%  BND0500 BINDER VERSION 'V21.0A00' STARTED
//START-LLM-CREATION INTERNAL-NAME=ASSPROG1
//INCLUDE-MODULES LIBRARY=*OMF,ELEMENT=*ALL
//RESOLVE-BY-AUTOLINK LIBRARY=$.SYSLNK.PERCON.030 &*————————————————————— (12)
//SAVE-LLM LIBRARY=ASS.PROG
%  BND1501 LLM FORMAT: '1'
//END
%  BND1101 BINDER NORMALLY TERMINATED. SEVERITY CLASS: 'OK' 
/CREATE-FILE FILE-NAME=PERS.SEL
/ADD-FILE-LINK - &*—————————————————————————————————————————————————————— (13)
/   FILE-NAME=PERS.SEL,- 
/   ACCESS-METHOD=*SAM,-
/   LINK-NAME=PCOUT
/START-EXECUTABLE-PROGRAM - &*——————————————————————————————————————————— (14)
/  FROM-FILE=*LIBRARY-ELEMENT(LIBRARY=ASS.PROG,ELEMENT-OR-SYMBOL=ASSPROG1)
//MODIFY-PERCON-OPTIONS SYSOUT-LOGGING=*ALL &*——————————————————————————— (15)
//ASSIGN-INPUT-FILE - &*————————————————————————————————————————————————— (16)
//   FILE=*DISK-FILE(NAME=PERS.DPT),-
//   LINK-NAME=PCIN
//ASSIGN-OUTPUT-FILE - &*———————————————————————————————————————————————— (17)
//   FILE=*DISK-FILE(NAME=PERS.SEL),-
//   LINK-NAME=PCOUT
//SELECT-INPUT-RECORDS CONDITION=((38,8)='FALMOUTH') &*—————————————————— (18)
//END &*————————————————————————————————————————————————————————————————— (19)
%  PER0030 NUMBER OF PROCESSED RECORDS FOR LINK='PCIN' 
          (FILE=:2OS6:$WKST.PERS.DPT):                  12

%  PER0030 NUMBER OF PROCESSED RECORDS FOR LINK='PCOUT' 
          (FILE=:2OS6:$WKST.PERS.SEL):                   1

%  PER0031 PERCON TERMINATED NORMALLY ——————————————————————————————————— (20)

(12)

The object module library $.SYSLNK.PERCON.030 is assigned for linkage.

(13)

The output file PERS.SEL is assigned with the link name PCOUT and its file attributes.

(14)

The program ASSPROG1 contained in the library ASS.PROG is called.

(15)

The branch to the PERCON subprogram has been made. PERCON statements are expected.

The MODIFY-PERCON-OPTIONS statement controls the output of the messages to SYSOUT. All the messages are output in full to SYSOUT.

(16)

The input file PERS.DPT is assigned.

(17)

The output file PERS.SEL is linked to PERCON via the link name PCOUT.

(18)

Any records containing C’FALMOUTH’ starting in column 38 are transferred to the output file.

(19)

The END statement starts the transfer operation and terminates PERCON.

(20)

PERCON is terminated normally.

Control then branches from the subprogram back to the main program.