1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-22 16:34:15 +00:00
C02/test/srec2asc.pas

43 lines
871 B
ObjectPascal
Raw Normal View History

2018-01-28 18:32:49 +00:00
Program Srec2asc;
{ SREC2ASC - Convert Motorola S-Record file to }
{ POM 1 ASCII File }
{ (C) 2017 - Curtis F Kaylor }
Uses
SysUtils, StrUtils;
Const
SrecExt = '.srec';
AscExt = '.asc';
Var
SrecFile: TextFile; {Input File}
AscFile: TextFile; {Output File}
Procedure OpenSrecFile;
Var
LastDot, LastSlash: Integer;
OpenResult: Integer;
Begin
SrecFileName := ParamStr(1);
LastDot := RPos('.', SrecFileName);
LastSlash := RPos('/', SrecFileName);
If LastDot <= LastSlash Then
SrecFileName := SrecFileName + SrecExt;
If Debug Then WriteLn('Opening File ', SrecFileName);
Assign(SrecFile, SrecFileName);
{$I-}
Reset(SrecFile);
OpenResult := IOResult;
{$I+}
If OpenResult <> 0 Then
Error('Error Opening Input File ' + SrecFileName);
End;
Begin
End;