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

{  The purpose of this procedure is determine the current value
{  of the traps enabled flag, disable traps and return the previous
{  value of the flag.
{
{    I#MTR_DISABLE_TRAPS (OLD_TE);
{
{  OLD_TE: (output) Value of the traps enabled flag at the time this
{                   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 (0c0(16), 0c0(16));
    #write_register (osc$pr_monitor_mask_reg, local_monitor_mask.int);

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