HPlogo MPE/iX Intrinsics Reference Manual > Chapter 10 Command Definitions (QUIT-ZSIZE)

XCONTRAP

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable (difference noted below).

Arms or disarms user-written subsystem break trap handling procedure.

Syntax



            I*V     I*
  XCONTRAP (plabel, oldplabel);


NOTE: Any user trap handler cannot perform a GOTO out of that procedure. Performing an ESCAPE (Pascal) or completing the trap handling procedure are the only valid ways to return. The state of the process and the program results are not predictable after a non-local GOTO statement.

Parameters


plabel

(NM) 32-bit signed integer by value (required)

(CM) 16-bit signed integer by value (required)

The plabel of the subsystem break trap handling procedure. It can be either an NM or a CM plabel. If the value is 0, the subsystem break trap handler is disarmed for the process.

Obtaining external plabels for the NM trap handling procedure depends on the programming language. In Pascal/XL, for example, obtain the plabel by using the waddress function. Supply the name of your subsystem break trap handler as an argument to waddress.

  1. Obtain the 16-bit external CM plabel of the CM subsystem break trap handler. One way to do this is by using the LOADPROC intrinsic.

  2. Pass this 16-bit plabel in the following 32-bit format:

(NM)

BitsValue/Meaning
31:1Set to 1
30:1Set to 0
29:1Set to 1
16:13Set to 0
0:1616-bit external CM plabel

(CM)

BitsValue/Meaning
0:1616-bit external CM plabel

oldplabel

(NM) 32-bit signed integer passed by reference (required)

(CM) 16-bit signed integer passed by reference (required)

Returns the plabel of the process's previous subsystem break trap handler. It can be either a CM or NM plabel, as described above. If no plabel was previously configured, oldplabel returns 0.

Operation Notes


Call XCONTRAP to arm a user-written subsystem break trap handling procedure. This trap handler is invoked when an enabled subsystem break signal is received during an interactive session. Calling XCONTRAP from a job results in an error.

On most terminals, transmit the subsystem break signal by pressing CTRL-Y (the default for sending a subsystem break signal). Subsystem break traps are also referred to as control-Y traps.

Only one process in a session can receive a subsystem break trap at any one time. The process that called XCONTRAP most recently receives the next subsystem break trap. Once a process has received a subsystem break trap, it cannot receive another until it calls the RESETCONTROL intrinsic to reenable the subsystem break trap. Only processes running in a session can enable subsystem break traps. The trap handler can be any procedure in the program or in the libraries to which the program is bound. The subsystem break trap handler has no parameters.

Condition Codes


CCE (2)Request granted. Trap enabled.
CCG (0)Request granted. Trap disabled.
CCL (1)Request denied. An illegal plabel or XCONTRAP was called from a job.

Related Information


Intrinsics RESETCONTROL, FCONTROL, FDEVICECONTROL, FREAD, FSETMODE, FWRITE, IODONTWAIT, IOWAIT, XARITRAP, XLIBTRAP, XSYSTRAP
Manuals Trap Handling Programmer's Guide




XARITRAP


XLIBTRAP