pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
15 Built-In Routines
Topics:
• Privileged Mode (page 274)
• Parameters (page 275)
• Hardware Indicators (page 276)
• Atomic Operations (page 276)
• Nonatomic Operations (page 281)
Built-in routine calls whose results do not depend on the values of variables (such as $LEN(n ) or
$INT(10D)) can be used wherever constant values are allowed.
The syntax descriptions in this section use these terms:
DefinitionTerm
Signed 16-bit integer. Range is -32,768 through 32,767.sINT
Unsigned 16-bit integer. Range is 0 through 65,535. Must be an INT variable,
not a STRING or UNSIGNED variable.
uINT
16-bit word unless otherwise specifiedword
“sINT” and “uINT” are not pTAL data types. This section uses them only to specify how built-in
routines use INT parameters.
Privileged Mode
Many built-in routines can be executed only by processes running in privileged mode.
Routines that operate in privileged mode can:
• Call other routines that operate in privileged mode
• Perform privileged operations by means of calls to system procedures
• Execute privileged instructions that can affect other programs or the operating system
• Use system global pointers and 'SG' equivalencing to:
Access system tables (which are described in the system description manual for your
system)
◦
◦ Access the system data area
◦ Compare and move data between the system data area and the user data area
◦ Initiate certain input-output transfers
(Only procedures that operate in privileged mode can access system global data.)
Routines that operate in privileged mode must be specially licensed, because they might (if
improperly written) adversely affect the status of the processor in which they are running.
The following execute in privileged mode:
• CALLABLE procedures (that is, procedures declared with the attribute CALLABLE)
• PRIV procedures (that is, procedures declared with the attribute PRIV)
• Nonprivileged procedures that are called by CALLABLE or PRIV procedures
• pTAL Privileged Routines (page 281)
274 Built-In Routines