diff --git a/src/disasm.rs b/src/disasm.rs index c10d745..237d1f2 100644 --- a/src/disasm.rs +++ b/src/disasm.rs @@ -712,7 +712,7 @@ impl Disassembler { }; Mnemonic::POP_M(mem) } - 0x90 => Mnemonic::NOP(), + 0x90 => Mnemonic::NOP, 0x91 => Mnemonic::XCHG_AX(Register::CX), 0x92 => Mnemonic::XCHG_AX(Register::DX), diff --git a/src/instructions.rs b/src/instructions.rs index 0d194f7..55041c1 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -21,7 +21,7 @@ impl Instruction { Instruction { addr: 0, raw: Vec::new(), - mnemonic: Mnemonic::NOP(), + mnemonic: Mnemonic::NOP, } } } @@ -58,7 +58,7 @@ impl fmt::Display for Instruction { // which then add all variants and also create the matching logic for // src/disasm.rs decode_instructions() pub enum Mnemonic { - NOP(), + NOP, // ADD ADD_FromReg(ModRmTarget, Register), // From Register into either Memory or Register ADD_ToReg(ModRmTarget, Register), // From either Memory or Register into Reigster diff --git a/src/interpreter/interpreter.rs b/src/interpreter/interpreter.rs index 595dc5d..f9bbfbc 100644 --- a/src/interpreter/interpreter.rs +++ b/src/interpreter/interpreter.rs @@ -115,6 +115,7 @@ impl Interpreter { ModRmTarget::Register(crate::register::Register::AX), ArithmeticOperand::Immediate(ImmediateOperand::Word(src_word)), )?, + /* * PUSH */ @@ -260,13 +261,19 @@ impl Interpreter { ModRmTarget::Register(crate::register::Register::AX), ArithmeticOperand::Immediate(ImmediateOperand::Word(src_word)), )?, + /* * Override */ + Mnemonic::OVERRIDE(_) => todo!(), /* * Decimal Adjust */ + Mnemonic::DAA => todo!(), + Mnemonic::DAS => todo!(), + Mnemonic::AAA => todo!(), + Mnemonic::AAS => todo!(), /* * SUB @@ -477,6 +484,14 @@ impl Interpreter { continue; } + /* + * Loops + */ + Mnemonic::LOOPNZ(_) => todo!(), + Mnemonic::LOOPZ(_) => todo!(), + Mnemonic::LOOP(_) => todo!(), + Mnemonic::JCXZ(_) => todo!(), + /* * Test */ @@ -600,10 +615,24 @@ impl Interpreter { /* * Push/Pop Flags */ + Mnemonic::PUSHF => todo!(), + Mnemonic::POPF => todo!(), + Mnemonic::SAHF => todo!(), + Mnemonic::LAHF => todo!(), /* * String Byte Operations */ + Mnemonic::MOVSB => todo!(), + Mnemonic::MOVSW => todo!(), + Mnemonic::CMPSB => todo!(), + Mnemonic::CMPSW => todo!(), + Mnemonic::STOSB => todo!(), + Mnemonic::STOSW => todo!(), + Mnemonic::LODSB => todo!(), + Mnemonic::LODSW => todo!(), + Mnemonic::SCASB => todo!(), + Mnemonic::SCASW => todo!(), /* * RET @@ -620,6 +649,9 @@ impl Interpreter { self.computer.regs.sp += w; continue; } + Mnemonic::IRET => todo!(), + Mnemonic::RETF => todo!(), + Mnemonic::RETF_Iw(_) => todo!(), /* * Load ES/DS Register @@ -801,15 +833,24 @@ impl Interpreter { /* * IN */ + Mnemonic::IN_AL(_) => todo!(), + Mnemonic::IN_AX(_) => todo!(), + Mnemonic::IN_ALDX => todo!(), + Mnemonic::IN_AXDX => todo!(), /* * OUT */ + Mnemonic::OUT_AL(_) => todo!(), + Mnemonic::OUT_AX(_) => todo!(), + Mnemonic::OUT_ALDX => todo!(), + Mnemonic::OUT_AXDX => todo!(), /* * INT */ Mnemonic::INT(id) => self.interpret_interrupt(id)?, + Mnemonic::INTO => todo!(), /* * Flag manipulation @@ -825,10 +866,14 @@ impl Interpreter { /* * Repeat prefixes */ + Mnemonic::REPNZ => todo!(), + Mnemonic::REPZ => todo!(), /* * Adjust */ + Mnemonic::AAM(_) => todo!(), + Mnemonic::AAD(_) => todo!(), /* * Misc @@ -837,7 +882,8 @@ impl Interpreter { log::info!("lock#"); continue; } - _ => log::info!("no action done"), + Mnemonic::XLAT => todo!(), + Mnemonic::NOP => {} } // Go to next instruction