summaryrefslogtreecommitdiff
path: root/insns.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-05-19 21:07:08 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-19 21:07:48 -0700
commit7a4928f484b9c2f1676349c421215cbb8766e030 (patch)
tree760448fcb0e14740d5a6b6a5b34e66fd44ec1b30 /insns.pl
parentdfa2a842bd3bdff14237d0a2abc9d0a4a3c2e5c9 (diff)
downloadnasm-7a4928f484b9c2f1676349c421215cbb8766e030.tar.gz
nasm-7a4928f484b9c2f1676349c421215cbb8766e030.tar.bz2
nasm-7a4928f484b9c2f1676349c421215cbb8766e030.zip
Bytecode compiler: add support for is4/imz2 operands
Diffstat (limited to 'insns.pl')
-rw-r--r--insns.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/insns.pl b/insns.pl
index 4f92503..0b5e1a3 100644
--- a/insns.pl
+++ b/insns.pl
@@ -673,6 +673,19 @@ sub byte_code_compile($) {
push(@codes, 0250+$oppos{'i'});
}
$prefix_ok = 0;
+ } elsif ($op eq 'is4' || $op eq 'imz2') {
+ if (!defined($oppos{'i'} || !defined($oppos{'s'}))) {
+ die "$0: $line: $op without 'i' and 's' operands\n";
+ }
+ push(@codes, 0172, ($oppos{'s'} << 3)+$oppos{'i'});
+ } elsif ($op =~ /^is4=([0-9]+)$/) {
+ 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";
+ }
+ push(@codes, 0173, ($oppos{'s'} << 4) + $1);
} elsif ($op =~ /^([0-9a-f]{2})\+s$/) {
if (!defined($oppos{'i'})) {
die "$0: $op without 'i' operand\n";