Previous: 4.74.2.31. SetFTime procedure To the Table of Contents Next: 4.74.2.33. SetTime procedure
4.74.2.31. SetFTime procedure Table of Contents 4.74.2.33. SetTime procedure

- 4.74.2.32. -
Table of Contents
4. Standard Units
4.74. WinDos - MS-DOS function emulation for OS/2 and Win32
4.74.2. WinDos Unit Procedures and Functions
4.74.2.32. SetIntVec procedure


4.74.2.32. SetIntVec procedure

Targets: MS-DOS only


Dos Unit, WinDos Unit

Sets a specified interrupt vector to a specified address.

Declaration:
procedure SetIntVec(IntNo: Byte; Vector: Pointer);
procedure SetIntVec(IntNo: Byte; Vector: FarPointer);
Remarks:
Interrupts may occur while in protected mode or while in real mode.

Example:
program Timer;
uses
  WinDos, Crt;
var
  Int1CSave: FarPointer;
  Time     : LongInt;
// timer handler
procedure TimerHandler(eip,eax,ecx,edx,ebx,esp,ebp,esi,edi:
                       Dword; gs,fs,es: Word); interrupt;
var
  StoreX, StoreY: Word;
begin
  Inc(time);
  Store X:= WhereX;
  Store Y:= WhereY;
  GotoXY(1,1);
  Write(time);
  GotoXY(StoreX, StoreY);
  Port[$20] := $20;
end;

// main program
begin 
  ClrScr;
  Time := 0;
  GetIntVec($1C, Int1CSave);
  SetIntVec($1C, @TimerHandler);
  Writeln;
  Writeln('Type something and press "ENTER" to exit');
  Readln;
  SetIntVec($1C, Int1CSave);
end.
See also:
GetIntVec
FarPointer


Previous: 4.74.2.31. SetFTime procedure To the Table of Contents Next: 4.74.2.33. SetTime procedure
4.74.2.31. SetFTime procedure Table of Contents 4.74.2.33. SetTime procedure

- 4.74.2.32. -