diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-05-20 09:36:41 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-05-20 09:36:41 -0700 |
commit | 24860b0f0e46182cac0bf4fea13f17f15d8232b2 (patch) | |
tree | 1d3d9d9b21f525e320d58a5ae154b508662d1998 | |
parent | e6fb38b9f2b9d0549142898725d723bf9cec748f (diff) | |
download | nasm-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...
-rw-r--r-- | insns.pl | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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"; |