Category : Utilities for DOS and Windows Machines
Archive   : EATMEM.ZIP
Filename : EATMEM.PAS

 
Output of file : EATMEM.PAS contained in archive : EATMEM.ZIP
{ Eatmem takes a command line parameter and "eats" memory to that size. }
{ Requires Turbo Power's Object Professional OPDOS unit. }
{$X+}
program eatmem;
uses crt,opdos;
var code : word;
mem : longint;
memate : longint;
memptr : array[1..20] of pointer;
numeat : longint;
i : integer;
st : string;
env : EnvRec;
begin
clrscr;
if paramcount=0 then
begin
writeln('Usage : ');
writeln(' eatmem memleft');
writeln;
writeln('where memleft is memory to be left after eating.');
halt(0);
end {:} else val(paramstr(1),mem,code);
memate := maxavail-mem+29376;
mem := maxavail-mem-3568;
if ((mem>0) and (mem begin
numeat := (mem div 32000) + 1;
for i := 1 to numeat do
if i < numeat then getmem(memptr[i],32000)
else getmem(memptr[i],mem-((numeat-1)*32000));
CurrentEnv(env);
st := GetEnvStr(Env,'PROMPT');
ShellWithPrompt('EATMEM : '+paramstr(1)+' (type EXIT to release)$_'+st,
NoExecDOSProc);
for i := 1 to numeat do
if i < numeat then freemem(memptr[i],32000)
else freemem(memptr[i],mem-((numeat-1)*32000));
end {:} else code := 9;
if code<>0 then writeln('EATMEM error : ',code)
else writeln(memate,' bytes released.');
end.

  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : EATMEM.ZIP
Filename : EATMEM.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/