On Tue, 12 Jul 2022, Jerome Shidel wrote:

I haven’t looked at the code for either. But, there are some things in general to consider with TSRs.

I would assume the memory footprint difference may be related to optimization of the executables layout and data storage. Basically, when you return to DOS, you release all the memory you don’t need. So, you store all the data you do need to keep in the beginning of the program. At start, jump past it and do all the initialization stuff. Then free everything you don’t need when you call the terminate-but-stay-resident interrupt.

You could even use areas of the PSP (program segment prefix) to store some data. For example, once processed, you could move data into the PSP command line buffer. Another thing, is to free the env segment. Maybe even Shuffle your own data and code around at run-time.

Lots of tricks like that.

I do use some of these tricks. There is code to free the environment, and the JMP at the beginning is zapped (it is organized to put the full resident portion in one place, starting at CS:0100).

I suppose I could step on zero page (PSP) but I don't know how safe that is. The graphics table is written at CS:0100-04FF (this could be why Microsoft's version is incompatible with mine, while mine is compatible with Microsoft's).

I could actually probably store most of CP437 up at the top to reduce .COM size.

-uso.
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to