hypervisor: emulator: emulate CMP

Unfortunately Rust stable does not yet have inline ASM support the flag
calculation will have to be implemented in software.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2020-12-03 12:55:10 +00:00
committed by Samuel Ortiz
parent dd3844a892
commit 93b7dcac12
3 changed files with 387 additions and 0 deletions
+6
View File
@@ -497,6 +497,12 @@ impl<'a, T: CpuStateManager> Emulator<'a, T> {
fn get_handler(code: Code) -> Option<Box<dyn InstructionHandler<T>>> {
let handler: Option<Box<dyn InstructionHandler<T>>> = gen_handler_match!(
code,
// CMP
(cmp, Cmp_rm32_r32),
(cmp, Cmp_rm8_r8),
(cmp, Cmp_rm32_imm8),
(cmp, Cmp_rm64_r64),
// MOV
(mov, Mov_r8_rm8),
(mov, Mov_r8_imm8),
(mov, Mov_r16_imm16),