summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-08-20 21:03:14 +0000
committerH. Peter Anvin <hpa@zytor.com>2007-08-20 21:03:14 +0000
commit85f5f148bb6536f326c3d3c0ba9c516998f2e798 (patch)
tree324ce704bfbd3cf8f41275dc8d88d5f1f56c2739
parentfc918885e03944afe47437c301a28bc1cba24d72 (diff)
downloadnasm-85f5f148bb6536f326c3d3c0ba9c516998f2e798.tar.gz
nasm-85f5f148bb6536f326c3d3c0ba9c516998f2e798.tar.bz2
nasm-85f5f148bb6536f326c3d3c0ba9c516998f2e798.zip
regs.pl: handle dashed sequences with suffixes
Handle dashed sequences with suffixes. Use that for r8-r15[bwd].
-rw-r--r--regs.dat36
-rwxr-xr-xregs.pl16
2 files changed, 16 insertions, 36 deletions
diff --git a/regs.dat b/regs.dat
index 14cdd50..79146f4 100644
--- a/regs.dat
+++ b/regs.dat
@@ -48,38 +48,10 @@ dil REG8 reg8_rex 7
di REG16 reg16 7
edi REG32 reg32 7
rdi REG64 reg64 7
-r8b REG8 reg8_rex 8
-r8w REG16 reg16 8
-r8d REG32 reg32 8
-r8 REG64 reg64 8
-r9b REG8 reg8_rex 9
-r9w REG16 reg16 9
-r9d REG32 reg32 9
-r9 REG64 reg64 9
-r10b REG8 reg8_rex 10
-r10w REG16 reg16 10
-r10d REG32 reg32 10
-r10 REG64 reg64 10
-r11b REG8 reg8_rex 11
-r11w REG16 reg16 11
-r11d REG32 reg32 11
-r11 REG64 reg64 11
-r12b REG8 reg8_rex 12
-r12w REG16 reg16 12
-r12d REG32 reg32 12
-r12 REG64 reg64 12
-r13b REG8 reg8_rex 13
-r13w REG16 reg16 13
-r13d REG32 reg32 13
-r13 REG64 reg64 13
-r14b REG8 reg8_rex 14
-r14w REG16 reg16 14
-r14d REG32 reg32 14
-r14 REG64 reg64 14
-r15b REG8 reg8_rex 15
-r15w REG16 reg16 15
-r15d REG32 reg32 15
-r15 REG64 reg64 15
+r8-15b REG8 reg8_rex 8
+r8-15w REG16 reg16 8
+r8-15d REG32 reg32 8
+r8-15 REG64 reg64 8
# Segment registers
cs REG_CS sreg 1
diff --git a/regs.pl b/regs.pl
index d8f53bc..6c1aa7e 100755
--- a/regs.pl
+++ b/regs.pl
@@ -24,11 +24,15 @@ sub process_line($) {
$dclasses = $3;
$x86regno = toint($4);
- if ($reg =~ /^(.*[^0-9])([0-9]+)\-([0-9]+)$/) {
+ if ($reg =~ /^(.*[^0-9])([0-9]+)\-([0-9]+)(|[^0-9].*)$/) {
$nregs = $3-$2+1;
$reg = $1.$2;
+ $reg_nr = $2;
+ $reg_prefix = $1;
+ $reg_suffix = $4;
} else {
$nregs = 1;
+ undef $reg_prefix, $reg_suffix;
}
while ($nregs--) {
@@ -44,9 +48,13 @@ sub process_line($) {
}
# Compute the next register, if any
- $x86regno++;
- if ($reg =~ /^(.*[^0-9])([0-9]+)$/) {
- $reg = sprintf("%s%u", $1, $2+1);
+ if (defined($reg_prefix)) {
+ $x86regno++;
+ $reg_nr++;
+ $reg = sprintf("%s%u%s", $reg_prefix, $reg_nr, $reg_suffix);
+ } else {
+ # Not a dashed sequence
+ die if ($nregs);
}
}
}