summaryrefslogtreecommitdiff
path: root/insns.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-05-20 09:36:41 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-20 09:36:41 -0700
commit24860b0f0e46182cac0bf4fea13f17f15d8232b2 (patch)
tree1d3d9d9b21f525e320d58a5ae154b508662d1998 /insns.pl
parente6fb38b9f2b9d0549142898725d723bf9cec748f (diff)
downloadnasm-24860b0f0e46182cac0bf4fea13f17f15d8232b2.tar.gz
nasm-24860b0f0e46182cac0bf4fea13f17f15d8232b2.tar.bz2
nasm-24860b0f0e46182cac0bf4fea13f17f15d8232b2.zip
Allow explicit immediate syntax for imz2 as well as is4
imz2 is just an alias for is4 as far as we are concerned...
Diffstat (limited to 'insns.pl')
-rw-r--r--insns.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/insns.pl b/insns.pl
index 7b4d8b4..ac63909 100644
--- a/insns.pl
+++ b/insns.pl
@@ -678,14 +678,15 @@ sub byte_code_compile($) {
die "$0: $line: $op without 'i' and 's' operands\n";
}
push(@codes, 0172, ($oppos{'s'} << 3)+$oppos{'i'});
- } elsif ($op =~ /^is4\=([0-9]+)$/) {
+ } elsif ($op =~ /^(is4|imz2)\=([0-9]+)$/) {
+ my $imm = $2;
if (!defined($oppos{'s'})) {
die "$0: $line: $op without 's' operand\n";
}
- if ($1 < 0 || $1 > 15) {
- die "$0: $line: invalid imm4 value for $op\n";
+ if ($imm < 0 || $imm > 15) {
+ die "$0: $line: invalid imm4 value for $op: $imm\n";
}
- push(@codes, 0173, ($oppos{'s'} << 4) + $1);
+ push(@codes, 0173, ($oppos{'s'} << 4) + $imm);
} elsif ($op =~ /^([0-9a-f]{2})\+s$/) {
if (!defined($oppos{'i'})) {
die "$0: $op without 'i' operand\n";