[fpc-pascal] DOS Timer Interrupt, serial Interrupt

Rainer Stratmann RainerStratmann at t-online.de
Wed Aug 9 18:07:13 CEST 2006


Hello Alexey,

the program is changed now, but is has the same effect.
May be it has to do with the special role of the timer interrupt.

Best regards
Rainer

program time;

uses crt,dos,go32;

var timervar:longint;

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

var
 htimeivecbak : tseginfo;  // old Interrupt Vector
 htimeivec    : tseginfo;  // new Interrupt Vector
const int_vectime = $1c;

procedure starttim;
begin
 get_pm_interrupt(int_vectime,htimeivecbak);
 htimeivec.offset:=@hardtime;
 htimeivec.segment:=get_ds;
 set_pm_interrupt(int_vectime,htimeivec);
end;

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

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


Am Mittwoch, 9. August 2006 13:35 schrieb Alexey Pavluchenko:
> Hello Rainer,
>
> Wednesday, August 09, 2006, 1:19:52 PM, you wrote:
>
> RS> is there a document or sample code for accessing the timer interrupt
> and the RS> serial interrupt in DOS mode.
>
> RS> This does not work:
> [skip]
>
> You should use get_pm_interrupt and set_pm_interrupt from GO32 unit
> instead of DOS unit procedures. At least it was so in FPC 1.x, I
> didn't try to compile anything for DOS with 2.x.



More information about the fpc-pascal mailing list