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 tkchia Homepage, 14.08.2021, 08:49
(edited by tkchia on 14.08.2021, 09:02)

Hello Laaca,

> 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

Actually the int 0x21, ah = 0x31 interface does allow one to specify how many paragraphs of memory one wants to keep resident. Turbo C and Watcom C also accept a paragraph count as a parameter to keep(...) and (respectively) _dos_keep(...).

But it might be hard to use this correctly in the context of high-level code. You need to arrange your program binary code in such a way that the resident portions will come before (most of) the transient portions (and you must take library functions into account too...). I am not sure what features Free Pascal (e.g.) has that might facilitate this sort of thing.

> 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?

That will likely not work --- DOS will free up all memory blocks allocated by your program, including those from int 0x21, ah = 0x48.

Thank you!

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

 

Complete thread:

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