SL> GM> I did post some code on resizing a COM program's memory and shelling
SL> GM> another program as a child process. Would you like for me to post it
SL> GM> again?
SL>
SL> Maybe the part of resizing would help me. Right now i'm just using Int
SL> 21/49h
SL> to free _all_ memory and allocate after with int 21/48h it worked fine
SL> but
SL> I wonder if there is another way to free the all memory but 64k of the
SL> current Com program.
Depends on what your gonna do with this memory. Before the "memory alloc"
calls were available to me, I used a word in the psp to determine the
highest segment of memory available (undocumented item). Since I was
single tasking, I was free to use the memory between my program and
top of TPA.
If I wanted to shell another program, I could load it's image above,
reset the stack to that segment, execute a far call to that segment
+ 100 (for com programs).
Of course, this was in the days when the INT20h was the way to exit
a program. It was tatamount to a far return.
I didn't do this often. I usually made "bin" image of my extra code
and named the extention OVL. This was quite handy when upper memory
became available. I could load the binary images into upper memory
areas and reserve them for later use. It sped up operations quite a
bit.
Ah, the old daze...
You only need to write a quick and dirty "de-alloc" once for com
programs. Just toss it in as a part of your code you write normally.
Unless your writing a TSR, which is a different matter entirely. :)
Glen...
--- ProBoard v2.16 [Reg]
---------------
* Origin: NC/NEC SEWAnet, Bucolic Fair (1:3407/25)
|