aboutsummaryrefslogtreecommitdiff
path: root/src/long_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/long_mode')
-rw-r--r--src/long_mode/mod.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs
index 5132973..7f9719c 100644
--- a/src/long_mode/mod.rs
+++ b/src/long_mode/mod.rs
@@ -236,9 +236,15 @@ impl RegSpec {
panic!("invalid x86 rex-byte reg {}", num);
}
+ let bank = if num < 4 {
+ RegisterBank::B
+ } else {
+ RegisterBank::rB
+ };
+
RegSpec {
num,
- bank: RegisterBank::rB
+ bank,
}
}
@@ -283,7 +289,7 @@ impl RegSpec {
rax => 0, rcx => 1, rdx => 2, rbx => 3,
rsp => 4, rbp => 5, rsi => 6, rdi => 7,
r8 => 8, r9 => 9, r10 => 10, r11 => 11,
- r12 => 8, r13 => 9, r14 => 14, r15 => 15
+ r12 => 12, r13 => 13, r14 => 14, r15 => 15
);
register!(D,