home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Party 1994: Try This At Home
/
disk_image.bin
/
source
/
astrasrc
/
postproc.pas
< prev
Wrap
Pascal/Delphi Source File
|
1994-08-13
|
876b
|
39 lines
(* special post processing utility for COM-files, cuts the unused
zeros from the end, JHH/93 *)
type
a = array [1..65535] of byte;
var
f : file;
b : ^a;
l : word;
s : word;
procedure xHalt (msg: string);
begin
write (msg);
halt;
end;
begin
if ParamCount <> 1 then xHalt ('usage: POSTPROC <com-file>');
if MaxAvail < 65535 then xHalt ('out of memory!');
GetMem (b, 65535);
assign (f, ParamStr (1));
{$I-}
reset (f, 1);
if ioResult <> 0 then xHalt ('usage: POSTPROC <com-file>');
write ('reading..');
blockread (f, b^, 65535, l);
close (f);
write (' processing..');
s := l;
while b^[s] = 00 do dec (s);
rewrite (f, 1);
write (' writing..');
blockwrite (f, b^, s);
close (f);
write (' total: ', s, ' bytes.');
end.