[fpc-pascal] DOS Timer Interrupt, serial Interrupt

Alexey Pavluchenko pavluchenko at isp.kiev.ua
Wed Aug 9 18:36:05 CEST 2006


Hello Rainer,

Wednesday, August 09, 2006, 7:07:13 PM, you wrote:

RS> Hello Alexey,

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

There is nothing really special about it. Int 1Ch is not even a
hardware interrupt.

RS> Best regards
RS> Rainer

RS> program time;

RS> uses crt,dos,go32;

RS> var timervar:longint;

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

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

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

This one should be get_cs, not get_ds. The procedure code must be
executed from the code segment, not from the data segment. While
physically the segments do overlap, selector values and access rights
are different.

-- 
Best regards,
 Alexey





More information about the fpc-pascal mailing list