diff options
author | iximeow <me@iximeow.net> | 2019-01-06 02:14:51 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-01-12 16:10:13 -0800 |
commit | ce7f79ff458c7a4abb2930094ea05781eb092ed2 (patch) | |
tree | 273914f9475623e96167324e06ac1639cee22b49 /test | |
parent | 0e581ea4608c9510c1c2eb18e943212df5c037da (diff) |
some more refactoring of RegSpec, support r-b registers, additional test cases
Diffstat (limited to 'test')
-rw-r--r-- | test/test.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test.rs b/test/test.rs index 83f24f9..166faff 100644 --- a/test/test.rs +++ b/test/test.rs @@ -45,6 +45,26 @@ fn test_mov() { } #[test] +fn test_stack() { + assert_eq!(&format!("{}", decode( + &[0x66, 0x41, 0x50] + ).unwrap()), "push r8w"); +} + +#[test] +fn test_prefixes() { + assert_eq!(&format!("{}", decode( + &[0x66, 0x41, 0x31, 0xc0] + ).unwrap()), "xor r8w, ax"); + assert_eq!(&format!("{}", decode( + &[0x66, 0x41, 0x32, 0xc0] + ).unwrap()), "xor al, r8b"); + assert_eq!(&format!("{}", decode( + &[0x40, 0x32, 0xc5] + ).unwrap()), "xor al, bpl"); +} + +#[test] fn test_control_flow() { assert_eq!(&format!("{}", decode( &[0x73, 0x31] |