diff options
author | iximeow <me@iximeow.net> | 2020-08-03 00:57:45 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-08-09 01:38:57 -0700 |
commit | 200447fed7f7fffa6c13360375b99b8d675b81ac (patch) | |
tree | 3cd135e78caeeebcf8349ddeaeafe590841848d1 | |
parent | 959c61e28e05a37aa19cc226d0f5b525610d47d7 (diff) |
more pop
-rw-r--r-- | src/long_mode/mod.rs | 11 | ||||
-rw-r--r-- | test/long_mode/mod.rs | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index e79c8cb..4ef7a04 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -5982,6 +5982,17 @@ fn read_operands<T: Iterator<Item=u8>>(decoder: &InstDecoder, mut bytes_iter: T, ][r as usize]; instruction.operand_count = 1; } + OperandCode::ModRM_0x8f_Ev => { + instruction.operands[0] = mem_oper; + let r = (modrm >> 3) & 7; + if r >= 1 { + return Err(DecodeError::InvalidOpcode); + } + instruction.opcode = [ + Opcode::POP, + ][r as usize]; + instruction.operand_count = 1; + } OperandCode::ModRM_0xff_Ev => { instruction.operands[0] = mem_oper; let r = (modrm >> 3) & 7; diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs index 0d81d02..291efd4 100644 --- a/test/long_mode/mod.rs +++ b/test/long_mode/mod.rs @@ -1132,6 +1132,8 @@ fn test_push_pop() { test_display(&[0x5b], "pop rbx"); test_display(&[0x41, 0x5e], "pop r14"); test_display(&[0x68, 0x7f, 0x63, 0xc4, 0x00], "push 0xc4637f"); + test_display(&[0x66, 0x8f, 0x00], "pop [rax]"); + test_display(&[0x8f, 0x00], "pop [rax]"); } #[test] |