unit IRQMThrdu; interface uses Windows, SysUtils, Classes; type TIRQThread = class(TThread) private protected procedure Execute; override; public IRQCount : DWord; IRQ: Byte; procedure UpdateIRQCaption; procedure UpdateStatusCaption; end; implementation uses IRQMFormu, ACCES32, W32IRQM; { IRQThread } procedure TIRQThread.UpdateIRQCaption; begin Form1.CountLabel.Caption := 'IRQ ' + IntToStr(IRQ) + ' Count: ' + IntToStr(IRQCount); Form1.LastIRQLabel.Caption := 'Last IRQ: ' + IntToStr(IRQ); end; procedure TIRQThread.UpdateStatusCaption; begin Form1.StatusLabel.Caption := 'Waiting...Generate IRQs now'; end; procedure TIRQThread.Execute; var IRQ_Occurred : Boolean; begin Synchronize(UpdateStatusCaption); repeat IRQ_Occurred := DetectIRQ(IRQ); if (IRQ_Occurred = true) then begin Inc(IRQCount); // send eoi SendEOI(IRQ); Synchronize(UpdateIRQCaption); end; until Terminated; end; end.