1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-28 10:51:14 +00:00
C02/work/srec2asc.pas
2018-08-11 00:18:23 -04:00

43 lines
871 B
ObjectPascal

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;