When you issue
the four bytes
(register 15)
call, control
control would
an SiC 202, you must supply an error return address in
immediately after the SiC instruction. If the return code
contains a nonzero value after returning from the SiC passes to the address specified. In the above example,
go to the instruction at the label ERROR.
If you want to ignore errors, you can use the sequence:
LA 1,PUNCHER SiC 202 DC AL4 (*+4)
If you do net specify an error address, control is returned to the next
instruction after a normal return, but if there was an error executing
the CMS command, your program terminates execution.
If you want to execute a CP command or an EXEC procedure from a
program, you must use the CP and EXEC commands; for example: SPOOL EXEC DS DC
DC
DC
DC
DC
DC
DC
DC
DC OD CLS'CP' CLS'SPOOL' CLS'PRINTER' CLS'CLASS' CLS'S' SX'FF' CLS'EXEC' CLS'PFSET' SX'FF' It is net possible to enter a parameter that is longer than eight
characters this way.
As an alternative, you can use the CMS LINEDIT
command from a program. Specify DISP=CPCOMM on the
for example:
macro to call a CP macro instruction;
LINEDIT TEXT='SPOOL E CLASS S',DISP=CPCOMM,DOT=NO On return from the execution of the LINEDIT macro instruction, register
15 contains the return code from the CP command.
The LINEDIT macro is described in VKLJIQ Another way to execute a CP command froll a program DIAGNOSE x'OS' instruction. For additional information Executing Program Modules is to use the
on this, see KODULE files, in CKS, are nonrelocatable programs. Using the GENMOD command, you can create a module from any program that uses OS or CMS macros. When you create a module, it is generated at the virtual
storage address at which it is loaded, for example:
load myprog
genmod testit
The eKS disk file, TESTIT KODULE A, that is created as a result of this GENKOD command, always begins execution at location X'20000', the
heginning of the user program area.
242 IBK VK/370 CMS User's Guide
Page of GC20-1819-2 As Updated April 27, 1981 by TNL SN25-0828 For 5748-XE1 If VOU want to call your own program modules using SVC 202 instructions, you must be careful not to execute a module that uses the
same area of storage that your program occupies. If you want to call a
module that executes at location X'20000', you can load the calling
proqram at a higher location; for example:
load mvprog (oriqin 30000 As long as the MODULE file called by MYPROG is no longer than X
i
10000'
bytes, it will not overlay your program. CMS disk-resident command modules that use the GENMOD command with
the STF option also execute in the user program area. If you call these
commands from a proqram, the pointers for the storage of the user area
are reset. This resetting could cause errors when returning to the
original program, but loading your program at a higher location avoids
this problem.
THE TRANSIENT PROGRAM AREA To avoid overlaying programs executing in the user program area, you can
generate program modules to run in the CMS transient area, which is a
two-page area of storage that is reserved for the execution of programs
that are called for execution frequently. Many CMS commands run in this
area, which is located at X'EOOO'. Programs that execute in this area
run disabled.
To generate a module to run in the transient area, use the ORIGIN TRANS option when vou load the TEXT file into storage, then issue the GENMOD command:
load myprog (origin trans
qenmod setup (str
Note: If a program running in the user area calls a transient routine in whIch a module was generated using the GENMOD command with the STR option, the user area storage pointers will be reset. This reset
condi tion
example,
program) • could
when
cause errors upon return to the original
as GETMAIN/FREEMAIN macros are issued
program
in the
(for
user
The two restrictions placed on command modules executing in the
transient area are:
1. They may have a maximum size of 8192 bytes, since that is the size
of the transient area. This size includes any free storage acquired
by GETMAIN macros.
2. They must be serially reusable. When a program is called by an SVC 202, if it has already been loaded into the transient area, it is
not reloaded. eMS Macro Instructions
There are a number of assembler language macros distributed with the CMS system that vou can use when you are writing programs to execute in the CMS environment. They are in the macro library CMSLIB MACLIB, which is
section 13. Programming for the CMS Environment 243
Previous Page Next Page