aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-08-09 19:25:07 -0700
committeriximeow <me@iximeow.net>2020-08-09 19:25:07 -0700
commit57ff56d8b5c3a3fa4f1d7f4881afbe2ce8e47cfd (patch)
tree81ed40ad1545fb88933245a7b2f78f53242c4ac8 /test
parentc06dd09585d192199f8f3068c69aecfae5d407f6 (diff)
support salc, get segment register numbers right
Diffstat (limited to 'test')
-rw-r--r--test/long_mode/mod.rs10
-rw-r--r--test/protected_mode/mod.rs10
2 files changed, 20 insertions, 0 deletions
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs
index ee20c47..25c8deb 100644
--- a/test/long_mode/mod.rs
+++ b/test/long_mode/mod.rs
@@ -1073,6 +1073,16 @@ fn test_mov() {
test_display(&[0x0f, 0x97, 0xc8], "seta al");
test_display(&[0x0f, 0x97, 0x00], "seta [rax]");
test_display(&[0x0f, 0x97, 0x08], "seta [rax]");
+ test_display(&[0xd6], "salc");
+ test_display(&[0x8e, 0x00], "mov es, [rax]");
+ // cs is not an allowed destination - would #ud on execution
+ test_display(&[0x8e, 0x08], "mov cs, [rax]");
+ test_display(&[0x8e, 0x10], "mov ss, [rax]");
+ test_display(&[0x8e, 0x18], "mov ds, [rax]");
+ test_display(&[0x8e, 0x20], "mov fs, [rax]");
+ test_display(&[0x8e, 0x28], "mov gs, [rax]");
+ test_invalid(&[0x8e, 0x30]);
+ test_invalid(&[0x8e, 0x38]);
}
#[test]
diff --git a/test/protected_mode/mod.rs b/test/protected_mode/mod.rs
index 8749935..185e98d 100644
--- a/test/protected_mode/mod.rs
+++ b/test/protected_mode/mod.rs
@@ -948,6 +948,16 @@ fn test_mov() {
test_display(&[0x0f, 0x97, 0xc8], "seta al");
test_display(&[0x0f, 0x97, 0x00], "seta [eax]");
test_display(&[0x0f, 0x97, 0x08], "seta [eax]");
+ test_display(&[0xd6], "salc");
+ test_display(&[0x8e, 0x00], "mov es, [eax]");
+ // cs is not an allowed destination - would #ud on execution
+ test_display(&[0x8e, 0x08], "mov cs, [eax]");
+ test_display(&[0x8e, 0x10], "mov ss, [eax]");
+ test_display(&[0x8e, 0x18], "mov ds, [eax]");
+ test_display(&[0x8e, 0x20], "mov fs, [eax]");
+ test_display(&[0x8e, 0x28], "mov gs, [eax]");
+ test_invalid(&[0x8e, 0x30]);
+ test_invalid(&[0x8e, 0x38]);
}
#[test]