
  PROCEDURE [INLINE] i#mtr_enable_traps (VAR old_te: 0 .. 3);
?? PUSH (LISTEXT := ON) ??

{  This procedure reads the current value of the traps enabled
{  register, enables traps and returns the previous value of the
{  traps enabled register.
{
{    I#MTR_ENABLE_TRAPS (OLD_TE);
{
{  OLD_TE: (output) Value of the traps enabled flag at the time the
{                   procedure was invoked.
{
{  NOTE - This procedure assumes the caller has 'monitor privilege';
{  this inline can only be used successfully in MONITOR mode.
{

    TYPE
      monitor_mask = RECORD
        CASE boolean OF
        = FALSE =
          mask: mtt$monitor_conditions,
        = TRUE =
          int: 0 .. 0ffff(16),
        CASEND,
      RECEND;

    VAR
      local_monitor_mask: monitor_mask;

    old_te := #read_register (0c0(16));
    local_monitor_mask.int := #read_register (osc$pr_monitor_mask_reg);
    local_monitor_mask.mask := local_monitor_mask.mask + $mtt$monitor_conditions [mtc$mcr_trap_enable_flag];
    #write_register (osc$pr_monitor_mask_reg, local_monitor_mask.int);
    #write_register (0c2(16), 0c2(16));

  PROCEND i#mtr_enable_traps;
*copyc mtt$monitor_conditions
*copyc osc$processor_defined_registers
?? POP ??
