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