use precompiled standard library (not really a linker)
This commit is contained in:
parent
5ce5bc44b8
commit
91cb059f38
8 changed files with 105 additions and 22 deletions
|
|
@ -9,7 +9,8 @@ var
|
|||
outfile:TextFile;
|
||||
infile:TextFile;
|
||||
lineno:integer;
|
||||
|
||||
infilePath,outfilePath:string;
|
||||
|
||||
procedure errorExit2(reason:string;arg:string); forward;
|
||||
|
||||
{$I 'platfile+.pas'}
|
||||
|
|
@ -78,6 +79,17 @@ begin
|
|||
clean := (not strcontains( name, '_')) and (name[1] <> '=');
|
||||
end;
|
||||
|
||||
procedure removeLeadingZeroes(var s:string);
|
||||
begin
|
||||
while length(s) > 1 do
|
||||
begin
|
||||
if s[1] = '0' then
|
||||
delete(s,1,1)
|
||||
else
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure processFile(inpath,outpath:string);
|
||||
var line:string;
|
||||
addr,name:string;
|
||||
|
|
@ -94,6 +106,8 @@ begin
|
|||
begin
|
||||
readln(infile, line);
|
||||
splitLine(line, addr, name, clean);
|
||||
removeLeadingZeroes(addr);
|
||||
|
||||
if clean then
|
||||
writeln(outfile, #9, '.EQU ', name, ' $', addr);
|
||||
end;
|
||||
|
|
@ -104,7 +118,13 @@ end;
|
|||
begin
|
||||
if ParamCount > 0 then
|
||||
begin
|
||||
processFile(ParamStr(1), getOutfileName(ParamStr(1)));
|
||||
infilePath := ParamStr(1);
|
||||
outfilePath := getOutfileName(infilePath);
|
||||
|
||||
if ParamCount > 1 then
|
||||
outfilePath := ParamStr(2);
|
||||
|
||||
processFile(infilePath, outfilePath);
|
||||
end
|
||||
else
|
||||
writeln('No file name given.');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue