Previous PageTable Of ContentsIndexNext Page


5 ASSEMBLING AND RUNNING PROGRAMS

5.1 Using the Assembler

5.2 Using the Binder

5.3 Creating and Using Object Modules

5.4 Using the Loader


Icon5 ASSEMBLING AND RUNNING PROGRAMSIcon

The procedures in this section are used to assemble, fully resolve (using the Binder), and execute Assembler Language programs.

5.1 Using the Assembler

The COMP procedure provides the user with a one-step procedure to assemble source code for diagnostic messages; and, if assembly is successful, to prepare the input for further processing (e.g., the LKGO procedure). This procedure stores the output of the Assembler into a temporary data set to be used later in the job and then deleted.

Symbolic Parameters for ASMHCOMP

Required

Value to be supplied

None

None

Optional

Value to be supplied

OPTIONS=parms

Assembler parameters

LIBNAME='aaaaiii.dsname'

Dsname of first user-defined macro library

LIBDISK=fileser

Volume for first library; required only if the data set is not cataloged

LIBSTOR=type

Unit name for first library; FILE is the default

ALTNAME='aaaaiii.dsname'

Dsname of second user-defined macro library

ALTDISK=fileser

Volume for second library; required only if the data set is not cataloged

ALTSTOR=type

Unit name for second library; FILE is the default

The internal stepname for the ASMHCOMP procedure is COMP.

Example 1:

     //stepname  EXEC  ASMHCOMP
     //COMP.SYSIN  DD  *
     (source program)

Example 2:

     //stepname  EXEC ASMHCOMP,LIBNAME='aaaaiii.dsname'
     //COMP.SYSIN  DD  *
     (source program)

Example 3:

     //stepname  EXEC  ASMHCOMP,OPTIONS='XREF(FULL),TEST'
     //COMP.SYSIN  DD  *
     (source program)

Use of the TEST facility is described in the TSO Extensions Command Language Reference, SC28-1881.

5.2 Using the Binder

The LKGO procedure performs the following:

It provides the user with the DD statements needed to use the printer (SYSOUT) and the SORT/MERGE messages data set (SORTMSGS). The user must provide additional JCL for any I/O units (data sets) used. Section 6.4 discusses specifying user-defined libraries with LKGO.

There must be one GO.ddname DD statement describing each data set used. DD statements to override ddnames within the procedure must precede those for ddnames to be added to the procedure. If more than one DD statement is being overridden, the override statements must be in the same order as the existing DD statements in the procedure. See the manual Batch Processing and Utilities at NIH for a description of the format of DD statements.

Symbolic Parameters for ASMHLKGO

Required

Value to be supplied

None

None

Optional

Value to be supplied

OPTIONS=parms

Binder parameters

CORE=nnnK

Region for GO step; 512K is the default

LIBNAME='aaaaiii.dsname'

Dsname of first user-defined library

LIBDISK=fileser

Volume for first library; required only if the data set is not cataloged

LIBSTOR=type

Unit name for first library; FILE is the default

ALTNAME='aaaaiii.dsname'

Dsname of second user-defined library

ALTDISK=fileser

Volume for second library; required only if the data set is not cataloged

ALTSTOR=type

Unit name for second library; FILE is the default

The stepnames within the ASMHLKGO cataloged procedure are LOAD for the Binder step and GO for the run step.

Example 4:

     //stepname  EXEC  ASMHCOMP
     //COMP.SYSIN  DD  *
     (source program)
     //stepname  EXEC  ASMHLKGO,OPTIONS=XREF
     //GO.ddname  DD  etc. (as many as needed)
     //GO.SYSIN  DD  *  (if needed)
     (data)

Example 5:

     //stepname EXEC ASMHCOMP
     //COMP.SYSIN DD *
     (source for main program)
     //stepname  EXEC  ASMHCOMP
     //COMP.SYSIN  DD  *
     (source for subroutine)
     //stepname  EXEC  ASMHLKGO,CORE=nnnK
     //GO.ddname  DD  etc. (as many as needed)
     //GO.SYSIN  DD  *  (if needed)
     (data)

5.3 Creating and Using Object Modules

The OBJ procedure is used to assemble source code and store the resultant object module into a sequential data set. The output of this procedure must be processed by the Binder before it can be run. The LKGO procedure may be used to fully resolve and execute the object module(s) created by the OBJ procedure(s).

Symbolic Parameters for ASMHOBJ

Required

Value to be supplied

NAME='aaaaiii.dsname'

Dsname of object module to be stored

Optional

Value to be supplied

DISK=fileser

Required only for a data set written to a dedicated disk

STORAGE=type

Unit name for the object module; FILE is the default

OPTIONS=parms

Assembler parameters

STATUS=status

Specifies whether the output data set is old or new; NEW is the default

SIZE=primary

Primary space allocation for object module; default is 500 (enough for approximately 500 source statements)

UNITS=type

Allocation units for object module; the default is blocks of 1024 bytes

LIBNAME='aaaaiii.dsname'

Dsname of first user-defined macro library

LIBDISK=fileser

Volume for first library; required only if the data set is not cataloged

LIBSTOR=type

Unit name for first library; FILE is the default

ALTNAME='aaaaiii.dsname'

Dsname of second user-defined macro library

ALTDISK=fileser

Volume for second library; required only if the data set is not cataloged

ALTSTOR=type

Unit name for second library; FILE is the default

The internal stepname for the ASMHOBJ procedure is COMP.

Example 6

     //stepname EXEC ASMHOBJ,NAME='aaaaiii.dsname' 
     //COMP.SYSIN  DD  * 
     (source program)

Example 7:

Example 8:

     //stepname EXEC ASMHOBJ,SIZE=primary,
     //  NAME='aaaaiii.dsname'
     //COMP.SYSIN DD *
     (source program)

To execute a program which has been stored by a OBJ procedure, use the ASMHLKGO procedure. The user must supply a //LOAD.SYSLIN DD statement describing the data set containing the program which was assembled and stored.

Example 9:

     //stepname EXEC ASMHOBJ,NAME='aaaaiii.dsname1'
     //COMP.SYSIN  DD  *
     (source program)
     //stepname EXEC ASMHLKGO
     //LOAD.SYSLIN DD DSN=aaaaiii.dsname1,DISP=SHR
     //GO.ddname  DD  etc. (as many as needed)
     //GO.SYSIN  DD  *  (if needed)
     (data)

Example 10:

     //stepname EXEC ASMHLKGO
     //LOAD.SYSLIN DD DSN=aaaaiii.dsname1,DISP=SHR
     //  DD  DSN=aaaaiii.dsname2,DISP=SHR
     //  DD  DSN=aaaaiii.dsname3,DISP=SHR
     //GO.ddname  DD  etc. (as many as needed)
     //GO.SYSIN  DD  *  (if needed)
     (data)

Example 11:

     //stepname EXEC ASMHCOMP
     //COMP.SYSIN DD *
     (source program)
     //stepname EXEC ASMHLKGO
     //LOAD.SYSLIN DD
     // DD DSN=aaaaiii.dsname1,DISP=SHR
     // DD DSN=aaaaiii.dsname2,DISP=SHR
     //GO.ddname  DD  etc. (as many as needed)
     //GO.SYSIN  DD  *  (if needed)
     (data)

5.4 Using the Loader

The LDGO procedure combines the Binder and run steps into one. The Loader will accept object modules and load modules. It will also search libraries defined by the SYSLIB DD statement within the procedure if unresolved external references remain after processing the primary input defined by the SYSLIN DD statement within the procedure. DD statements are provided for use of the printer (SYSOUT).

The LDGO procedure should be used during the early stages of program development (debugging); it is particularly recommended for the development of small and medium-sized programs. Using LDGO is often more economical than using LKGO, but a dump from a LDGO run may not be sufficient to resolve a problem. If so, the job may have to be rerun using the Binder (LKGO).

Additional technical information on the use of the Loader can be found in the manual Batch Processing and Utilities at NIH.

Symbolic Parameters for ASMHLDGO

Required

Value to be supplied

None

None

Optional

Value to be supplied

OPTIONS=parms

Loader and GO parameters

CORE=nnnK

Region for GO step; 300K is the default

EPT=entry

Entry point for the main program; no default is supplied

LIBNAME='aaaaiii.dsname'

Dsname of first user-defined macro library

LIBDISK=fileser

Volume for first library; required only if the data set is not cataloged

LIBSTOR=type

Unit name for first library; FILE is the default

ALTNAME='aaaaiii.dsname'

Dsname of second user-defined macro library

ALTDISK=fileser

Volume for second library; required only if the data set is not cataloged

ALTSTOR=type

Unit name for second library; FILE is the default

The internal stepname for the ASMHLDGO procedure is GO.

Example 12:

     //stepname  EXEC  ASMHCOMP
     //COMP.SYSIN  DD  *
     (source program)
     //stepname  EXEC  ASMHLDGO,OPTIONS=XREF
     //GO.ddname  DD  etc. (as many as needed)
     //GO.SYSIN  DD  *  (if needed)
     (data)

Using Assembler Language at the NIH Computer Center - September 1998
Comments

Previous PageTop Of PageTable Of ContentsIndexNext Page