* update to use i386ins.dat

This commit is contained in:
peter 1999-10-28 09:47:45 +00:00
parent f5a9e30c98
commit 26a239136d
2 changed files with 546 additions and 531 deletions

View File

@ -1,3 +1,18 @@
{
$Id$
Copyright (c) 1999 by Peter Vreman
Convert insns.dat from Nasm to an i386ins.dat for usage with
the Free pascal compiler
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
program fixnasm;
{$ifndef FPC}
@ -32,7 +47,7 @@ var
s : string;
i,j : longint;
begin
writeln('Fixing insns.dat -> insns.new');
writeln('Fixing insns.dat -> i386ins.dat');
assign(t,'insns.dat');
reset(t);
assign(f,'insns.new');
@ -53,6 +68,7 @@ begin
begin
writeln(f,'');
writeln(f,'[',Copy(s,1,i-1),']');
writeln(f,'(Ch_All, Ch_None, Ch_None)');
lastop:=opcode;
end;
while (i<length(s)) and (s[i+1]=' ') do
@ -82,3 +98,9 @@ begin
close(f);
close(t);
end.
{
$Log$
Revision 1.2 1999-10-28 09:47:45 peter
* update to use i386ins.dat
}

View File

@ -2,7 +2,7 @@
$Id$
Copyright (c) 1999 by Peter Vreman and Florian Klaempfl
Convert insns.dat from Nasm to a .inc file for usage with
Convert i386ins.dat from Nasm to a .inc file for usage with
the Free pascal compiler
See the file COPYING.FPC, included in this distribution,
@ -176,6 +176,24 @@ procedure skipspace;
inc(i);
end;
procedure openinc(var f:text;const fn:string);
begin
writeln('creating ',fn);
assign(f,fn);
rewrite(f);
writeln(f,'{ don''t edit, this file is generated from i386ins.dat }');
writeln(f,'(');
end;
procedure closeinc(var f:text);
begin
writeln(f);
writeln(f,');');
close(f);
end;
var
hs : string;
j : longint;
@ -199,32 +217,16 @@ begin
writeln('Nasm Instruction Table Converter Version ',Version);
insns:=0;
maxinfolen:=0;
assign(infile,'insns.dat');
{ open dat file }
assign(infile,'i386ins.dat');
reset(infile);
assign(insfile,'i386tab.inc');
rewrite(insfile);
writeln(insfile,'{ don''t edit, this file is generated from insns.dat }');
writeln(insfile,'(');
assign(opfile,'i386op.inc');
rewrite(opfile);
writeln(opfile,'{ don''t edit, this file is generated from insns.dat }');
writeln(opfile,'(');
assign(attfile,'i386att.inc');
rewrite(attfile);
writeln(attfile,'{ don''t edit, this file is generated from insns.dat }');
writeln(attfile,'(');
assign(attsuffile,'i386atts.inc');
rewrite(attsuffile);
writeln(attsuffile,'{ don''t edit, this file is generated from insns.dat }');
writeln(attsuffile,'(');
assign(intfile,'i386int.inc');
rewrite(intfile);
writeln(intfile,'{ don''t edit, this file is generated from insns.dat }');
writeln(intfile,'(');
assign(propfile,'i386prop.inc');
rewrite(propfile);
writeln(propfile,'{ don''t edit, this file is generated from insns.dat }');
writeln(propfile,'(');
{ create inc files }
openinc(insfile,'i386tab.inc');
openinc(opfile,'i386op.inc');
openinc(attfile,'i386att.inc');
openinc(attsuffile,'i386atts.inc');
openinc(intfile,'i386int.inc');
openinc(propfile,'i386prop.inc');
first:=true;
opcode:='';
firstopcode:=true;
@ -400,30 +402,21 @@ begin
write(insfile,' )');
inc(insns);
end;
writeln(insfile);
writeln(insfile,');');
writeln(attfile);
writeln(attfile,');');
writeln(attsuffile);
writeln(attsuffile,');');
writeln(intfile);
writeln(intfile,');');
writeln(opfile);
writeln(opfile,');');
writeln(propfile);
writeln(propfile,');');
close(infile);
close(insfile);
close(intfile);
close(attfile);
close(attsuffile);
close(opfile);
close(propfile);
closeinc(insfile);
closeinc(intfile);
closeinc(attfile);
closeinc(attsuffile);
closeinc(opfile);
closeinc(propfile);
writeln(insns,' nodes procesed (maxinfolen=',maxinfolen,')');
end.
{
$Log$
Revision 1.4 1999-10-27 16:06:52 peter
Revision 1.5 1999-10-28 09:47:45 peter
* update to use i386ins.dat
Revision 1.4 1999/10/27 16:06:52 peter
* updated for new layout
Revision 1.3 1999/08/12 14:36:09 peter