HP 3000 Manuals

XCONTRAP [ Trap Handling Programmer's Guide ] MPE/iX 5.0 Documentation


Trap Handling Programmer's Guide

XCONTRAP 

Arms or disarms the user-written CONTROL-Y trap handling procedure.

Syntax 

The XCONTRAP intrinsic is called as follows:
________________________________________________________________________
|                                                                      |
|XCONTRAP(plabel,oldplabel);                                           |
________________________________________________________________________

Parameters 

The XCONTRAP intrinsic has two required parameters:

plabel                    32-bit signed integer passed by value 
                          (required) 

                          The plabel of your CONTROL-Y trap handling
                          procedure.  This plabel can be either an NM or
                          a CM plabel.  If this value is 0, XCONTRAP
                          disarms CONTROL-Y traps for this process.

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

                          Returns the plabel of your process' previous
                          CONTROL-Y trap handler.  This plabel can be
                          either a CM or NM plabel, as described above.
                          If no plabel was previously configured,
                          oldplabel returns 0.

Passing NM Plabels.  How you obtain the external plabel (plabel) of your
NM trap handling procedure depends on your programming language.  In HP
Pascal/XL, for example, you can obtain the plabel by using the waddress
function.  Supply the name of your CONTROL-Y trap handler as an argument
to waddress.

Refer to the appropriate language reference manual for information on
obtaining external plabels of procedures.

Passing CM Plabels.  To pass a CM plabel, set it up as follows:

   1.  Obtain the 16-bit external CM plabel of your CM CONTROL-Y 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:

                   Bits                     Setting 

                  (0:16)                    16-bit external CM plabel.

                  (16:13)                   Reserved for future use.  Set to zero.

                  (29:1)                    Set to 1.

                  (30:1)                    Set to 0.

                  (31:1)                    Set to 1.

Condition Codes 

The XCONTRAP intrinsic can return one of the following condition codes:

CCE              Request granted.  Trap armed.

CCG              Request granted.  Trap disarmed.

CCL              Request denied because of an illegal plabel, or because
                 XCONTRAP was called from a job.



MPE/iX 5.0 Documentation