Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (T-V)
Guardian Procedure Calls Reference Manual—522629-013
15-59
USESEGMENT Procedure
(Superseded by SEGMENT_USE_ Procedure )
Syntax for TAL Programmers
Parameters
old-segment-id returned value
INT
returns the segment ID of the previously used selectable segment, if any;
otherwise, it returns -1.
If
segment-id specifies a flat segment, old-segment-id returns the segment
ID of the current in-use selectable segment. The flat segment and the selectable
segment remain addressable by the calling process.
segment-id input
INT:value
if present, is the segment ID of the segment is to be used or -1 if no segment is
used. If this parameter is not supplied, the current in-use selectable segment
remains unchanged and
old-segment-id returns the current in-use selectable
segment ID. Note that
old-segment-id is returned even if segment-id is not
valid, in which case the
old-segment-id parameter continues to remain the in-
use segment.
Condition Code Settings
< (CCL) indicates that segment-id is not allocated, or that the segment cannot
be used by a nonprivileged caller.
= (CCE) indicates that the operation is successful.
> (CCG) does not return from USESEGMENT.
Considerations
•
Because segment relocation is done, the first byte of any selectable extended data
segment has the address %2000000D (%H00080000).
•
Selectable segments and performance
If you have more than one selectable segment, you might face performance
degradation, because time is wasted when switching between the selectable
segments. This is because only one selectable segment is visible at a time.
Instead, use flat segments, which are always visible.
•
See “Considerations” for the ALLOCATESEGMENT procedure.
old-segment-id := USESEGMENT [ ( segment-id ) ]; ! i