aboutsummaryrefslogtreecommitdiff
path: root/test/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.rs')
-rw-r--r--test/test.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test.rs b/test/test.rs
index df94aeb..1e73a2e 100644
--- a/test/test.rs
+++ b/test/test.rs
@@ -38,6 +38,23 @@ fn test_display(data: &[u8], expected: &'static str) {
}
#[test]
+fn test_system() {
+ test_display(&[0x45, 0x0f, 0x22, 0xc8], "mov cr9, r8");
+ test_display(&[0x45, 0x0f, 0x20, 0xc8], "mov r8, cr9");
+ test_display(&[0x40, 0x0f, 0x22, 0xc8], "mov cr1, rax");
+ test_display(&[0x0f, 0x22, 0xc8], "mov cr1, rax");
+ test_display(&[0x44, 0x0f, 0x22, 0xcf], "mov cr9, rdi");
+ test_display(&[0x0f, 0x22, 0xcf], "mov cr1, rdi");
+ test_display(&[0x0f, 0x20, 0xc8], "mov rax, cr1");
+
+ test_display(&[0x45, 0x0f, 0x23, 0xc8], "mov dr9, r8");
+ test_display(&[0x45, 0x0f, 0x21, 0xc8], "mov r8, dr9");
+ test_display(&[0x40, 0x0f, 0x23, 0xc8], "mov dr1, rax");
+ test_display(&[0x0f, 0x23, 0xc8], "mov dr1, rax");
+ test_display(&[0x0f, 0x21, 0xc8], "mov rax, dr1");
+}
+
+#[test]
fn test_arithmetic() {
test_display(&[0x81, 0xec, 0x10, 0x03, 0x00, 0x00], "sub esp, 0x310");
}