[fpc-pascal] DOS Timer Interrupt, serial Interrupt

Rainer Stratmann RainerStratmann at t-online.de
Wed Aug 9 12:19:52 CEST 2006


Hello,

is there a document or sample code for accessing the timer interrupt and the 
serial interrupt in DOS mode.

Rainer


This does not work:

program time;

uses crt,dos;

var timervar:longint;

procedure hardtime; interrupt;
begin
 inc(timervar);
end;

var htimeivecbak : pointer;  // Interrupt Vector
const int_vectime = $1c;

procedure starttim;
begin
 timervar:=0;
 getintvec(int_vectime,htimeivecbak);
 setintvec(int_vectime, at hardtime);
end;

procedure stoptim;
begin
 setintvec(int_vectime,htimeivecbak);
end;

begin
 starttim;
 repeat
  writeln(timervar);
 until keypressed;
 readkey;
 stoptim;
end.



More information about the fpc-pascal mailing list