home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PARADIS1
/
EXEHEAD.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-03-26
|
2KB
|
57 lines
(4756) Sun 22 Mar 92 11:12
By: Joseph Crea
To: Gerald Gutierrez
Re: memory allocation woes
St:
---------------------------------------------------------------------------
@PID: QE 2.75
Gerald, here's that program for trimming the memory requirements of
executable programs. It's particualarly useful when you are using
TASM and want to use DOS function $48 to control memory allocation
yourself. Enjoy. (Written and tested under Turbo Pascal 5.0)
program trim_exe;
type exeheader_rec = record
exsignature : word; { $5a4d }
exExtraBytes : word;
exPages : word;
exRelocItems : word;
exHeaderSize : word;
exMinAlloc : word;
exMaxAlloc : word;
exInitSS : word;
exCheckSum : word;
exInitIP : word;
exInitCP : word;
exRelocTable : word;
exOverlay : word;
end;
var
f : file of exeheader_rec;
x : exeheader_rec;
begin
assign( f, paramstr(1) );
reset(f);
read(f, x);
if x.exsignature = $5A4D then
begin
with x do
exmaxalloc := exminalloc;
reset(f);
write(f, x);
end;
close(f);
end.
Joe Crea
--- QuickBBS 2.76 (Gamma-1)
* Origin: 221B Baker Street * Panama City FL * 904-871-6536 (1:3608/3)
@PATH: 3608/1 123/19 396/1 170/400 512/0 1007