Interrupt Handling
Previous  Top  Next


Attention! - we only deal with hardware interrupts! TVicHW32 does not support DOS/BIOS functions call. It is assumed that a user is well familiar with hardware interrupts and has some relevant experience.

The UnmaskInterrupt method unmasks specified Irq number at hardware level. So, if the OnHwInterrupt even handler has been installed it called every time when the hardware interrupt occurs.
It works as follows:


  var
    IrqCounter : Longword;

// The interrupt handler 
procedure TIrqForm.OnHwInterrupt(IrqNumber: Word);
begin
  Inc(IrqCounter); // increase interrupt counter
end;
  ...

  // Main program
  HW32.OpenDriver
  if HW32.ActiveHW then
  begin
    HW32.UnmaskInterrupt(7); // unmask Irq7 (LPT)
  end
  else ... // failed

Calling the MaskInterrupt stops hardware interrupt processing:

  HW32.MaskInterrupt;

Important!: Irq0 (system timer) cannot be used  

The IrqMasked property shows if the current Irq number is masked or not.