60 lines
926 B
Plaintext
60 lines
926 B
Plaintext
const
|
|
MaxLnLen : Integer = 64;
|
|
MaxRLen : Integer = 32;
|
|
DumpBytes: Integer = 16;
|
|
IRecEOF : String[11] = ':00000001FF';
|
|
|
|
type
|
|
LnStr = String[64];
|
|
|
|
{irec stores an individual record.}
|
|
irec = record
|
|
Addr : Integer;
|
|
Data : array [1..32] of Byte;
|
|
Count : Byte;
|
|
MaxCount : Byte;
|
|
end;
|
|
|
|
|
|
function GetDumpCnt(Line : LnStr): Byte;
|
|
begin
|
|
|
|
end;
|
|
|
|
|
|
function RdDumpLn(Line : LnStr): irec;
|
|
var
|
|
lrec : irec;
|
|
begin
|
|
lrec.Addr := ReadWord(Line);
|
|
while (lrec.Count < DumpBytes) do
|
|
begin
|
|
lrec.Count := lrec.Count + 1;
|
|
end;
|
|
|
|
RdDumpLn := lrec;
|
|
end;
|
|
|
|
function IRecCS(rec : irec) : Byte;
|
|
var
|
|
cksm : Integer = 0;
|
|
begin
|
|
cksm := rec.Addr + rec.Count;
|
|
|
|
IRecCS := Byte(cksm and $00FF);
|
|
end;
|
|
|
|
procedure wrirec(rec : irec);
|
|
var
|
|
I : Byte;
|
|
begin
|
|
Write(':');
|
|
Write(WriteByte(rec.Count));
|
|
Write(WriteWord(rec.Addr));
|
|
|
|
for I := 1 to rec.Count do
|
|
Write(WriteByte(rec.Data[I]));
|
|
|
|
Writeln(WriteByte(IRecCS(rec)));
|
|
end;
|