diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-08-20 21:03:14 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-08-20 21:03:14 +0000 |
commit | 85f5f148bb6536f326c3d3c0ba9c516998f2e798 (patch) | |
tree | 324ce704bfbd3cf8f41275dc8d88d5f1f56c2739 /regs.pl | |
parent | fc918885e03944afe47437c301a28bc1cba24d72 (diff) | |
download | nasm-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].
Diffstat (limited to 'regs.pl')
-rwxr-xr-x | regs.pl | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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); } } } |