From 11524fe292cfd4f40d9c7127c0e82ff1ef3e9793 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 30 Mar 2019 15:27:43 -0700 Subject: starting to get into some system instructions now --- test/test.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') 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"); } -- cgit v1.1