hi all,

i know it's a non 32-bit related question, but who know 32 bit asm probably have clear ideas about old dos asm programming...

i was wandering if someone could explain some things about PSP:

In a com file, PSP is included in the file until 100h or it is written by the dos on opening the com file ?

I mean, the PSP is the first part of the .com file or it's just written in memory before 100h by the dos?

thanks B7
Posted on 2002-03-08 14:08:55 by Bit7
The DOS loader creates it.
Byte 1 of the COM file is byte 100h in memory.
Posted on 2002-03-08 14:23:57 by bitRAKE

The PSP is written in memory before the com file is loaded so the COM code is loaded at 100 hex. You can do some interesting stuff like use the PSP as extra memory if you choose the right part of it. Command line storage is one area that you can safely overwrite with your own data.

You should be able to find a PSP map somewhere so that you know what you can do with it after the COM file is loaded.


Posted on 2002-03-08 15:10:51 by hutch--
What's more, you can use the PSP to find the PSP of the program that spawned your program. Years ago, I used this method to write a stub that would determine if the program had been started from the command prompt, and if so, it would manipulate the keyboard buffer to force command.com to start windows with my program. 'course Chicago kind of rendered that useless.
Posted on 2002-03-08 23:09:25 by Canite
Another nice trick was to overwrite PSP at position 5Ch by shifting back your code, so that you could make your TSRs really tiny :-)
Posted on 2002-03-09 03:38:10 by micmic
thanks all,

now i've the ideas more clear.

Posted on 2002-03-09 05:42:19 by Bit7