diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 20:52:08 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 20:52:08 +0000 |
commit | d7ed89eac9580f280fe0017b22c8e38ca75ed8e3 (patch) | |
tree | 98c4fcdd286b44e14f79aa65271e5caa1c2c7be4 /insns.pl | |
parent | ea8382740dbe5e1607742d0a7c7c139dffcc5ae5 (diff) | |
download | nasm-d7ed89eac9580f280fe0017b22c8e38ca75ed8e3.tar.gz nasm-d7ed89eac9580f280fe0017b22c8e38ca75ed8e3.tar.bz2 nasm-d7ed89eac9580f280fe0017b22c8e38ca75ed8e3.zip |
NASM 0.94
Diffstat (limited to 'insns.pl')
-rw-r--r-- | insns.pl | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -21,14 +21,14 @@ while (<F>) { split; next if $#_ == -1; # blank lines (warn "line $line does not contain four fields\n"), next if $#_ != 3; - $formatted = &format(@_); + ($formatted, $nd) = &format(@_); if ($formatted) { $insns++; $aname = "aa_$_[0]"; push @$aname, $formatted; } $opcodes[$opcodes++] = $_[0], $done{$_[0]} = 1 if !$done{$_[0]}; - if ($formatted && $formatted !~ /IF_ND/) { + if ($formatted && !$nd) { push @big, $formatted; foreach $i (&startbyte($_[2])) { $aname = sprintf "dd_%02X",$i; @@ -105,9 +105,9 @@ printf STDERR "Done: %d instructions\n", $insns; sub format { local ($opcode, $operands, $codes, $flags) = @_; - local $num; + local $num, $nd = 0; - return undef if $operands eq "ignore"; + return (undef, undef) if $operands eq "ignore"; # format the operands $operands =~ s/:/|colon,/g; @@ -124,9 +124,10 @@ sub format { # format the flags $flags =~ s/,/|IF_/g; + $flags =~ s/(\|IF_ND|IF_ND\|)//, $nd = 1 if $flags =~ /IF_ND/; $flags = "IF_" . $flags; - "{I_$opcode, $num, {$operands}, \"$codes\", $flags},"; + ("{I_$opcode, $num, {$operands}, \"$codes\", $flags},", $nd); } # Here we determine the range of possible starting bytes for a given |