LA R1,PLIST SVC 202 DC AL4(ERROR) PLIST DS OF DC CLB'SUBCOM' SUBCNAME DC CLB'name' COMMAND NAME SUBCPSW DC XL2'0000' SYSTEM MASK, STORAGE KEY, ETC.
DC AL2(O) RESERVED SUBCADDR DC A (*-*) ENTRY ADDRESS, -1 FOR QUERY DC A(O) USER WORD SUBCOM creates an SCBLOCK control block containing the information speci­
fied in the SUBCOM parameter list. SVC 202 uses this control block to locate the
specified routine. The SUBCOM chain of SCBLOCKs is released at the com­
pletion of a command (that is, when CMS displays the Ready message). See VM/SP Data Areas and Control Block Logic, Volume 2 for a description of the SCBLOCK control block.
When a program issues an SVC 202 call to a program that has become known to CMS via SUBCOM, it places X'02' in the high-order byte of register one. Control
passes to the called program at the address specified by the called program when it
invoked SUBCOM. The PSW specifies the system mask, the PSW key to be used, the program mask
(and initial condition code), and the starting address for execution. The
problem-state bit and machine-check bit may be set. The machine-check bit has
no effect in CMS under CPo The EC-mode bit and wait-state bit cannot be set;
they are always forced to zero. Also, one 4-byte user-defined word can be associ­
ated with the SUBCOM entry point, and referred to when the entry point is subse­
quently called.
Note: When control passes to the specified entry point, the register contents are:
R2 Address of SCBLOCK for this entry point.
R 12 Entry point address.
R13 24-word save area address.
R 14 Return address (CMSRET).
R15 Entry point address.
You can also use SUBCOM to delete the potential linkage to a program or rou­
tine's SCBLOCK, or to determine if an SCBLOCK exists for a program or routine.
To delete a program or routine's SCBLOCK, issue:
DC CLB'SUBCOM' DC CLB'program or routine name'
DC BX'OO' To determine if an SCBLOCK exists for a program or routine, issue:
DC CLB'SUBCOM' DC CLB'program or routine name'
DC A(O) SCBLOCK addressed as a returned value
DC 4X'FF'
Functional Information 347
Note that if 'SUBCOM name' is called from an EXEC file, the Query PLIST is the
form of PLIST which will be issued.
To query the chain anchor issue:
DC CL8'SUBCOM' DS CL8 DS AL4
DC AL4 (1)
(contents not relevant)
Will receive chain anchor
contents from NUCSCBLK. Indicates request for anchor.
Note that the anchor will be equal to F'O' if there are no SCBLOCKs on the chain.
Return codes from SUB COM are:
o -Successful completion. A new SCBLOCK was created, the specified SCBLOCK was deleted, or the specified program or routine has an SCBLOCK. 1 -No SCBLOCK exists for the specified program or routine. This is the
return code for a delete or a query.
25 -No more free storage available.· SCBLOCK cannot be created for the spec­
ified program or routine.
Note: If you create SCBLOCKS for several programs or routines with the same
name, they will all be remembered, but only the last one to be created will be used.
A SUBCOM delete request for that name will eliminate only the most recently cre­
ated SCBLOCK, making active the next most recently created SCBLOCK with the
same name.
When control returns to CMS after a console input command has terminated, the
entire SUBCOM chain SCBLOCKs is released; none of the subcommands estab­
lished during that command are carried forward to be available during execution of
the next console command.
System Product Editor Interface to Access Files in Storage CMS uses the SUBCOM facility to allow a number of CMS commands to use an
XEDIT interface to access files in storage. Applications can read or write specific
records without having to go to disk or use the program stack to transfer the data
to or from XEDIT. This improves performance.
This interface is used internally by CMS for processing the FILELIST, HELP,
PEEK, and SEND FILE commands. The interface is invoked by specifying the
XEDIT option on the LISTFILE or NAMEFIND commands. This option may
only be specified from the XEDIT environment.
When using this interface from an application program, only the extended Parame­
ter List can be used, and the high-order byte of of Register 1 must contain X'02' to
indicate SUBCOM is being used.
The application can invoke this interface via SVC 202 or via a BALR instruction.
Because XEDIT is a nucleus-resident routine, other nucleus-resident routines can
branch directly to it while routines that do not resides in the nucleus use SVC link­
age. When using an SVC 202, register 1 must point to the FSCB where the name
of the routine being invoked is the first token. The high-order byte of register 1
348 VM/SP System Programmer's Guide
Previous Page Next Page