summaryrefslogtreecommitdiff
path: root/insns.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-05-21 10:34:33 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-21 10:34:33 -0700
commiteb9e0938403b63e6478d6d874285a39e9984dbda (patch)
tree07ae5a0817f9e05b58cc7f256c48ab991aa446b0 /insns.pl
parent39d6ac6f791bc2e16f09c47055b1a46e34445118 (diff)
downloadnasm-eb9e0938403b63e6478d6d874285a39e9984dbda.tar.gz
nasm-eb9e0938403b63e6478d6d874285a39e9984dbda.tar.bz2
nasm-eb9e0938403b63e6478d6d874285a39e9984dbda.zip
Fix skipping 0270 code when searching for disasm prefixes
The 0270 code was incorrectly entered as 270 (decimal), which meant that instructions with vex but no .nds got misfiled in the improper opcode tables.
Diffstat (limited to 'insns.pl')
-rw-r--r--insns.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/insns.pl b/insns.pl
index 8199732..bbb1702 100644
--- a/insns.pl
+++ b/insns.pl
@@ -406,6 +406,8 @@ sub hexstr(@) {
# \1[0123] mean byte plus register value
# \330 means byte plus condition code
# \0 or \340 mean give up and return empty set
+# \17[234] skip is4 control byte
+# \26x \270 skip VEX control bytes
sub startseq($) {
my ($codestr) = @_;
my $word, @range;
@@ -461,11 +463,11 @@ sub startseq($) {
return addprefix($prefix, $c1..($c1+15));
} elsif ($c0 == 0 || $c0 == 0340) {
return $prefix;
- } elsif (($c0 & ~3) == 0260 || $c0 == 270) {
- shift(@codes);
- shift(@codes);
- } elsif ($c0 == 0172) {
+ } elsif (($c0 & ~3) == 0260 || $c0 == 0270) {
+ shift(@codes); # Skip VEX control bytes
shift(@codes);
+ } elsif ($c0 >= 0172 && $c0 <= 174) {
+ shift(@codes); # Skip is4 control byte
} else {
# We really need to be able to distinguish "forbidden"
# and "ignorable" codes here