kcpmtk/dump.pas

50 lines
787 B
Plaintext
Raw Normal View History

program dump;
{
dump emulates the version of DUMP.COM that comes with some
CP/M distributions.
}
{$I 'binary.pas'}
{$I 'common.pas'}
procedure DumpChunk(
var src : BinFile;
var dst : Text;
var addr : Integer,
var chunk : Byte);
var
buffer : array [1 .. 16] of Byte;
begin
Write(dst, WriteWord(addr));
Write(dst, ' ');
end;
procedure DumpFile(var src : BinFile; var dst : Text);
var
Address : Integer;
Size : Integer;
Buffer : array [1 .. 16] of Byte;
Chunk : Byte;
begin
Address := 0;
Size := FileSize(src);
Chunk := IMin($10, Size);
FillChar(Buffer, $10, $0);
WriteLn('Chunk: ', Chunk);
end;
var
inf : BinFile;
begin
Assign(inf, 'dump.bin');
Reset(inf);
DumpFile(inf, Output);
end.