CALLED ROUTINE START-UP TABLE
Figures 5 and 6 show how the PSW and registers are set up when the
called routine is entered.
r I "Called" Type System Mask 1--------------- ISVC 202 or 203 Disabled I - Nucleus I resi1ent 1--------------- -------------- ISVC 202 or 203 - Transient
area MODULE SVC 202 or 203 - User area User- handled
as - DOS/VS Nucleus
resident
as - DOS/VS Transient
area module
Disabled
Enabled
Enabled
Disabled Storage Key Problem Bit System Off User Off User Off User Off System Off System Off Figure 5. PSW Fields When Called Routine Starts
,
Registers RegisterslRegisterlRegister RegistertRegisterl
Type o -1 2 -11 1 12 I 13 14 I 15 I I I 1 I SVC 202 Same as Unpre- IAddress IUser Return 'Address I or 203 caller dictable I of I save address' of I I called I area to I called I , routine I , routine I ----I I I I other Same as Same as IAdd ress IUser Return ISame as I caller caller I of I save address I caller , 1 caller , area to , 1 I I I I Figure 6. Register Contents When Called Routine Starts RETURNING TO THE CALLING ROUTINE When the called routine finishes processing, control is returned to DMSITS, which in turn returns control to the calling routine.
The return is accomplished by leading the original SVC old PSi (which
was saved at the time DMSITS was first entered), after possibly modifying the address field. The address field modification depends upon the type of SVC call, and upon whether or not the called routine
indicated an error return. eftS Introduction 2-31
For SVC 202 and 203, the called routine indicates a normal return by
placing a zero in register 15 and an error return by placing a nonzero
code in register 15. If the called routine indicates a normal return,
then DMSITS makes a normal return to the calling routine. If the called
routine indicates an error return, DMSITS passes the error return to the
calling routine, if one was specified, and abnormally terminates if none was specified.
For an SVC 202 not followed by "DC AL4(address)", a normal return is
.ade to the instruction following the SVC instruction, and an error
return causes an abend. For an SVC 202 followed by "DC a
normal return is made to the instruction following the DC, and an error
return is made to the address specified in the DC. In either case,
register 15 contains the return code passed back by the called routine.
For an SVC 203 with a positive half word code, a normal return is .ade
to the instruction following the half word code, and an error return
causes an abend. For an SVC 203 with a negative halfword code, both normal and error returns are made to the instruction following the
halfword code. In any case, register 15 contains the return code passed by the called routine. For macro simulation SVC calls, and for user-handled SVC calls, no
error return is recognized by DMSITS. As a result, DftSITS always
returns to the calling routine by loading the SVC old PSW, which was
saved when DMSITS was first entered. Upon entry to DMSITS, all registers are saved as they were when the SVC instruction was first executed. Upon exiting from DMSITS, all registers
are restored fro. the area in which they were saved at entry.
The exception to this is register 15 in the case of SVC 202 and 203. Upon return to the calling routine, register 15 always contains the
value that was in register 15 when the called routine returned to DftSIIS after it had completed processing.
If the called routine
storage protect key of Save Area, has system status, so that it runs with a PSW 0, then it may store new values into the System If the called routine wishes to modify the location to which control is to be returned, it must modify the following fields: For SVC 202 and 203, it must modify the NUftRET and ERRET (normal and
error return address) fields. For other SVCs, it must modify the address field of OLDPSW. To modify the registers that are to be returned to the calling routine,
the fields EGPR1, EGPR2, ••• , EGPR15 must be modified.
If this action is taken by the called routine, then thp. SVCTRACE facility may print misleading information, since SVCTRACE assumes that
these fields are exactly as they were when D!SITS was first entered. Whenever an SVC call is made, DMSITS allocates two save areas for that
particular SVC call. Save areas are allocated as needed. For each SVC call, a system and user save area are needed.
2-32 IBM VM/310 System Logic and Program Determination--Volume 2
Previous Page Next Page