• Please review our updated Terms and Rules here

Turbo Pascal memory TSR

watlers_world

Experienced Member
Joined
Jan 21, 2016
Messages
58
Location
Ohio
Creating TSR drivers in Turbo Pascal 6 or 7 is very easy.

I created a TSR to reserve some conventional memory for a windows driver:

{$S-,N-}
{$M 1024, 0, 0}
Program PCIUSB64;

Uses
Crt,Dos;

Var SavedInt99h:pointer;
Var segm,offs:word;

type datahold=record
a1:word;
a2:word;
a3:word;
a4:word;
a5:word;
a6:word;
a7:word;
a8:word;
end;

var dh:datahold;

Procedure Int99h(AX, BX, CX, DX, SI, DI, DS, ES, BP:Word); interrupt;
begin
ax:=segm;
bx:=offs;
cx:=$FADE
end;


begin
GetIntVec($99, SavedInt99h);
SetIntvec($99, @Int99h);
Writeln('TSR installed.');
segm:=seg(dh);
offs:=ofs(dh);
Keep(0);
end.


Earlier Turbo Pascal versions are not as good with TSR drivers and lack inline assembly.
Can a simple TP program reserve conventional or extended memory without staying resident?
 
Back
Top