- 4.24.2.31 -
Standard Units
Dos Unit
Dos Unit Procedures and FunctionsSetIntVec 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
Dos, 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
|
|
|
SetFTime procedure |
Table of Content |
SetTime procedure |
- 4.24.2.31 -