Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

How to keep resident only a part of the program (Developers)

posted by Laaca Homepage, Czech republic, 08.03.2022, 12:24

I succeeded to solve this problem!
It is possible to create a big program in the Turbopascal and keep only a tiny TSR in the memory and unloaded the rest.
The practical implementation I used here.

The principle is to write a small assembler procedure which will be used as a TSR. In this procedure keep a area which will be modified on the fly to store there some data.
Then move this procedure/module just after PSP of the main program. (PSP+256)
Now is it a little bit dangerous because a part of the pascal system library is overwritten so it is not safe to call many RTL functions.
In assembler redirect the calling interrupt vector to PSP+256
Then call the DOS function 31h and into DX store the 16+TSR_size/16.
And it works :-)

The question is: Do I need to keep the PSP? Is it safe to perform the relocation not to PSP+256 but to PSP+128? Or to PSP+0?

---
DOS-u-akbar!

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 58 users online (0 registered, 58 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum