Laaca Czech republic, 14.08.2021, 07:31 |
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. --- |
tkchia 14.08.2021, 08:49 (edited by tkchia, 14.08.2021, 09:02) @ Laaca |
How to keep resident only a part of the program |
Hello Laaca, --- |
Laaca Czech republic, 14.08.2021, 10:32 @ tkchia |
How to keep resident only a part of the program |
> Actually the int 0x21, ah = 0x31 interface does allow one to specify how --- |
tom Germany (West), 14.08.2021, 11:40 @ Laaca |
How to keep resident only a part of the program |
> But I know that many assembler programs CAN do it. They use the INT |
RayeR CZ, 14.08.2021, 15:49 @ tom |
How to keep resident only a part of the program |
> and make sure that resident_stuff never calls anything in more_stuff after --- |
Laaca Czech republic, 14.08.2021, 20:18 @ RayeR |
How to keep resident only a part of the program |
> I see problem there when resident code would call anything from runtime --- |
RayeR CZ, 16.08.2021, 03:22 @ Laaca |
How to keep resident only a part of the program |
> But I am considering another attitude. At first to load tiny assembler --- |
tom Germany (West), 14.08.2021, 11:28 @ tkchia |
How to keep resident only a part of the program |
> Hello Laaca, |
ecm Düsseldorf, Germany, 15.08.2021, 13:47 @ tkchia |
How to keep resident only a part of the program |
> > Is possible solution to allocate a additional memory block via --- |
bretjohn Rio Rancho, NM, 27.08.2021, 21:22 @ ecm |
How to keep resident only a part of the program |
I use ecm's TSR installation method (or at least a slight variation of it) in most of my TSR's nowadays. It works really well. It even allows you to automatically install the program into upper memory without needing to use LOADHI. I'm not sure you could do it (at least not easily) in anything other than ASM, though. ASM is more difficult to use, but can give you complete control over everything, including the relationships of which parts of the program get installed in which parts of memory. |
marcov 14.08.2021, 13:18 @ Laaca |
How to keep resident only a part of the program |
> I am thinking about very tiny resident utility which hooks the INT16 |
CandyMan 27.08.2021, 17:46 @ Laaca |
How to keep resident only a part of the program |
If you want to write resident programs then use assembler. Here is my old program, replacement for the DOS keyboard driver, written in fasm. The resident part is between KeyStart and KeybSize. |
bretjohn Rio Rancho, NM, 27.08.2021, 21:47 @ Laaca |
How to keep resident only a part of the program |
From a performance perspective, this would not be a good way to implement a keyclick program. You have the sound being turned on, waiting, and turning off all inside an INT 09 (hardware IRQ) handler, which is not a good idea. The keyboard is a very high priority IRQ (the only one being higher is the clock at INT 08) and the machine will "stall" inside the IRQ 09 handler waiting for the sound to stop. This could cause some serious performance issues in other programs. |
Laaca Czech republic, 08.03.2022, 12:24 @ Laaca |
How to keep resident only a part of the program |
I succeeded to solve this problem! --- |
tom Germany (West), 08.03.2022, 12:51 @ Laaca |
How to keep resident only a part of the program |
> The question is: Do I need to keep the PSP? |
tkchia 08.03.2022, 14:20 @ tom |
How to keep resident only a part of the program |
Hello Laaca, hello tom, --- |
bretjohn Rio Rancho, NM, 08.03.2022, 19:19 @ tkchia |
How to keep resident only a part of the program |
As far as to how much of the PSP you need to keep after the TSR is installed, the answer is usually 0. Except in very rare cases, the PSP is only used while the TSR is being installed but is not used by the TSR itself. So, you can overwrite the PSP with whatever you want. I've used the PSP for various different things in my TSR's, the most useful probably being as a TSR Stack (complicated TSR's should always provide their own stack space). |
rr Berlin, Germany, 08.03.2022, 17:32 @ Laaca |
How to keep resident only a part of the program |
> I succeeded to solve this problem! --- |