How to keep resident only a part of the program (Developers)
I am thinking about very tiny resident utility which hooks the INT16 interrupt. I know that "high-level" languages like pascal or C have something like function Keep (which apparently calls INT21h/AH=31h). But this function keep a whole program in memory.
My problem is that the program must be quite big and complex (it performs some hardware detections and scanning). But after gathering all needed informations is possible to keep in memory only very small module.
All examples about KEEP function look similarly:
{ Keep.PAS }
{$M $800,0,0 } { 2K stack, no heap }
{ This program makes a click after each keypress.}
uses Crt, Dos;
var
KbdIntVec : Procedure;
{$F+}
procedure Keyclick; interrupt;
begin
if Port[$60] < $80 then
{ Clicks after keypress }
begin
Sound(5000);
Delay(1);
Nosound;
end;
inline ($9C); { PUSHF -- Push flags }
{ Call old driver }
KbdIntVec;
end;
{$F-}
begin
{ Insert into interrupt chain }
GetIntVec($9,@KbdIntVec);
SetIntVec($9,Addr(Keyclick));
Keep(0); { Teminate and keep resident }
end.
This program works but it remains all int the memory. I would like to keep only the procedure KeyClick but nothing more.
Is possible solution to allocate a additional memory block via INT21h/AH=48h, copy the code of KeyClick into this block and the program end not with Keep but hith Halt?
---
DOS-u-akbar!
Complete thread:
- How to keep resident only a part of the program - Laaca, 14.08.2021, 07:31 (Developers)
- How to keep resident only a part of the program - tkchia, 14.08.2021, 08:49
- How to keep resident only a part of the program - Laaca, 14.08.2021, 10:32
- How to keep resident only a part of the program - tom, 14.08.2021, 11:40
- How to keep resident only a part of the program - RayeR, 14.08.2021, 15:49
- How to keep resident only a part of the program - Laaca, 14.08.2021, 20:18
- How to keep resident only a part of the program - RayeR, 16.08.2021, 03:22
- How to keep resident only a part of the program - Laaca, 14.08.2021, 20:18
- How to keep resident only a part of the program - RayeR, 14.08.2021, 15:49
- How to keep resident only a part of the program - tom, 14.08.2021, 11:40
- How to keep resident only a part of the program - tom, 14.08.2021, 11:28
- How to keep resident only a part of the program - ecm, 15.08.2021, 13:47
- How to keep resident only a part of the program - bretjohn, 27.08.2021, 21:22
- How to keep resident only a part of the program - Laaca, 14.08.2021, 10:32
- How to keep resident only a part of the program - marcov, 14.08.2021, 13:18
- How to keep resident only a part of the program - CandyMan, 27.08.2021, 17:46
- How to keep resident only a part of the program - bretjohn, 27.08.2021, 21:47
- How to keep resident only a part of the program - Laaca, 08.03.2022, 12:24
- How to keep resident only a part of the program - tom, 08.03.2022, 12:51
- How to keep resident only a part of the program - tkchia, 08.03.2022, 14:20
- How to keep resident only a part of the program - bretjohn, 08.03.2022, 19:19
- How to keep resident only a part of the program - tkchia, 08.03.2022, 14:20
- How to keep resident only a part of the program - rr, 08.03.2022, 17:32
- How to keep resident only a part of the program - tom, 08.03.2022, 12:51
- How to keep resident only a part of the program - tkchia, 14.08.2021, 08:49