Category : Pascal Source Code
Archive   : INT101.ZIP
Filename : INTERUPT.PAS

 
Output of file : INTERUPT.PAS contained in archive : INT101.ZIP
{$R-,S+,I+,D+,T+,F-,V+,B-,N-,L+ }
{$M 4096,0,0 }

program interrupt_table (keyboard,monitor);

{

A Program that displays all interrupt vectors.

Version 1.01 - 04/17/88

Kevin Mess
PO Box 35
Boulder City, NV 89005
Compuserve 71121,3360

Revision History:

1.01 - Modified display_screen procedure to show original interrupts
before being changed by the Turbo Pascal runtime environment.
Also modified hex function to remove temp variable and speed
up the routine.

}

uses
crt,dos,cursors; { Cursors unit as written by Scott Bussinger }

const
bell = ^G;

type
string4 = string [4];
keyset = (ESC,PGUP,PGDN,nothing);
pointer_rec = record
case integer of
0 : (address : pointer);
1 : (offset, segment : word)
end; { record }
screentype = record
position : array [1..4000] of byte;
col,row : byte;
end; { record }
var
vector : array [$00..$FF] of pointer_rec absolute $0000:0000;
colorscreen : screentype absolute $B800:0000;
monoscreen : screentype absolute $B000:0000;
savedscreen : screentype;
intnumber : byte;
finished : Boolean;

{*************************************}

function hex (decimal : word) : string4;

const
hexdigit : array [$0..$F] of char = '0123456789ABCDEF';

begin
hex := hexdigit [ hi (decimal) div 16 ] +
hexdigit [ hi (decimal) mod 16 ] +
hexdigit [ lo (decimal) div 16 ] +
hexdigit [ lo (decimal) mod 16 ]
end;

{*************************************}

procedure frame (x1,y1,x2,y2 : byte);

const
upperleft = #201;
lowerleft = #200;
upperright = #187;
lowerright = #188;
horizontal = #205;
vertical = #186;

var
i : byte;

begin
gotoxy (x1-1,y1-1);
write (upperleft);
gotoxy (x2+1,y1-1);
write (upperright);
gotoxy (x1-1,y2+1);
write (lowerleft);
gotoxy (x2+1,y2+1);
write (lowerright);
for i := x1 to x2 do
begin
gotoxy (i,y1-1);
write (horizontal);
gotoxy (i,y2+1);
write (horizontal)
end;
for i := y1 to y2 do
begin
gotoxy (x1-1,i);
write (vertical);
gotoxy (x2+1,i);
write (vertical)
end;
end; { frame }


{*************************************}

procedure display_screen (first_intnumber : byte);

var
col,row,
last_intnumber,
intnumber : byte;
temp_ptr : pointer_rec;

begin { display_screen }
last_intnumber := first_intnumber + $3F;
col := 5;
row := 1;
for intnumber := first_intnumber to last_intnumber do
begin
gotoxy (col,row);
write (copy (hex (intnumber),3,2));
case intnumber of
$00 : temp_ptr.address := saveint00;
$02 : temp_ptr.address := saveint02;
$23 : temp_ptr.address := saveint23;
$24 : temp_ptr.address := saveint24;
$75 : temp_ptr.address := saveint75
else temp_ptr := vector [intnumber]
end; { case }
write (hex (temp_ptr.segment):6,':',hex (temp_ptr.offset));
inc (row);
if ((intnumber + 1) mod $10) = 0 then
if intnumber <> last_intnumber then
begin
inc (col,19);
row := 1
end { if }
end { for }
end; { display_screen }


{*************************************}


function endkey : keyset;

var
anykey : char;
exit : keyset;

begin
repeat
exit := nothing;
anykey := readkey;
if anykey = #0 then
anykey := readkey;
case anykey of
#27 : exit := ESC;
#73 : exit := PGUP;
#81 : exit := PGDN;
else write (bell);
end; { case }
until exit in [ESC,PGUP,PGDN];
endkey := exit
end;

{*************************************}

procedure int_table (intnumber : byte);

begin { int_table }
if monodisplay then
savedscreen := monoscreen
else
begin
savedscreen := colorscreen;
textcolor (white);
textbackground (blue)
end;
savedscreen.col := wherex;
savedscreen.row := wherey;
makecursor (nocursor);
frame (2,2,79,19);
window (2,2,79,19);
clrscr;
gotoxy (12,18);
write ('PgUp - Previous Page, PgDn - Next Page, Esc to Exit');
finished := FALSE;
repeat
display_screen (intnumber);
case endkey of
PGUP : if intnumber >= $40 then
dec (intnumber,$40)
else
intnumber := $C0;
PGDN : if intnumber <= $80 then
inc (intnumber,$40)
else
intnumber := $00;
ESC : finished := TRUE
end { case }
until finished;
window (1,1,80,25);
if monodisplay then
monoscreen := savedscreen
else
colorscreen := savedscreen;
gotoxy (savedscreen.col,savedscreen.row)
end; { int_table }

{*************************************}


begin { main }
intnumber := $00;
int_table (intnumber)
end. { main }


  3 Responses to “Category : Pascal Source Code
Archive   : INT101.ZIP
Filename : INTERUPT.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/