SVC TYPES AND LINKAGE CONVENTIONS conventions are important to dU! discussion of eMS because the system is driven by SVCs (supervisor calls). SVCs 202 and 203 are the
most common CMS SVCs. SVC 202 is used
calling routines
modules).
both for
written
calling nucleus-resident routines, and for
as commands (for example, disk resident
A typical coding sequence for an SVC 202 call is the following:
LA R1,PLIST SVC 202 DC AL4(ERRADD) Whenever SVC 202 is called, register 1 must point to a parameter list (PLIST). The format of this parameter list depends upon the actual
routine or command being called, but the SVC handler will examine the
first eight bytes of this parameter list to find the name of the routine
or command being called.
The "DC AL4(address) " instruction following the SVC 202 is optional,
and may be omitted if the programmer does not expect any errors to occur
in the routine or command being called. If included, error return is
made to the address specified in the DC. DMSITS determines whether this
DC was inserted by examining the byte following the SVC call inline. A
nonzero byte indicates an instruction, a zero value indicates that "DC
AL4(address)" follows. SVC 203 is called by CKS macros to perform various internal system
functions. It is used to define SVC calls for which no parameter list
is provided. For example, DKSFREE parameters are passed in registers 0 and 1.
A typical calling sequence for an SVC 203 call is as follows: SVC 203 DC H'code'
The halfword decimal code following the SVC 203 indicates the
specific routine being called. DKSITS examines this halfword code,
taking the absolute value of the code by an LPR instruction. The first
byte of the result is ignored, and the second byte of the resulting
halfword is used as an index to a branch table. The address of the
correct routine is loaded, and control is transferred to it.
It is possible for the address in the SVC 203 index table to be zero.
In this case, the index entry will contain an 8-byte routine or command
name, which will be handled in the same way as the 8-byte name passed in the paraaeter list to an SVC 202. Part 3. Conversational Monitor System (CMS) 257
The programmer indicates an error return by the sign of the halfword
code. If an error return is desired, then the code is negative. If the
code is positive, then no error return is made. The sign of the
halfword code has no effect on determining the routine that is to be
called, since DftSITS takes the absolute value of the code to determine
the routine called.
Since only the second byte of the absolute value of the code is
examined by DftSITS, seven bits (bits 1-7) are available as flags or for
other Thus. for example
i
DMSFREE uses these seven bits to indicate such things as conditional requests and variable requests. When an SVC 203 is invoked, DMSITS stores the halfword code into the KUCOK location CODE203, so that the called routine can examine the seven
bits made available to it.
All calls made by means of SVC 203 should be made by macros, with the macro expansion computing and specifying the correct halfword code.
The programmer may use the HNDSVC macro to specify the address of a
routine that will handle any SVC call other than for SVC 202 and SVC 203. In this case, the linkage conventions are as required by the
user-specified SVC-handling routine. CMS supports selected SVC calls generated by as and DOS/VS macros, by simulating the effect of these macro calls. DftSITS is the initial SVC interrupt handler. If the SET DOS command has been issued, a flag in NUCON will indicate that DOS/VS macro simulation is to be used. Control
is then passed to DftSDOS. Otherwise, as macro simulation is assumed and DftSITS passes control to the appropriate OS simulation routine.
There are several types of invalid SVC calls recognized by DftSITS. 1. Invalid SVC number. If the SVC number does not fit into any of the
four classes described above, then it is not handled by In appropriate error message is displayed at the terminal, and control
is returned directly to the caller.
258 IBM VM/370 System programmer's Guide
Previous Page Next Page