diff --git a/InstructionSets/x86/Implementation/PerformImplementation.hpp b/InstructionSets/x86/Implementation/PerformImplementation.hpp index 685324897..f1defbfe5 100644 --- a/InstructionSets/x86/Implementation/PerformImplementation.hpp +++ b/InstructionSets/x86/Implementation/PerformImplementation.hpp @@ -202,7 +202,7 @@ inline void aad(CPU::RegisterPair16 &ax, uint8_t imm, Status &status) { } template -inline void aam(CPU::RegisterPair16 &ax, uint8_t imm, Status &status, FlowControllerT &flow_controller) { +void aam(CPU::RegisterPair16 &ax, uint8_t imm, Status &status, FlowControllerT &flow_controller) { /* tempAL ← AL; AH ← tempAL / imm8; (* imm8 is set to 0AH for the AAD mnemonic *) @@ -622,7 +622,7 @@ void inc(IntT &destination, Status &status) { } template -inline void jump(bool condition, IntT displacement, RegistersT ®isters, FlowControllerT &flow_controller) { +void jump(bool condition, IntT displacement, RegistersT ®isters, FlowControllerT &flow_controller) { /* IF condition THEN @@ -736,12 +736,12 @@ void not_(IntT &destination) { } template -inline void call_relative(IntT offset, RegistersT ®isters, FlowControllerT &flow_controller) { +void call_relative(IntT offset, RegistersT ®isters, FlowControllerT &flow_controller) { flow_controller.call(registers.ip() + offset); } template -inline void call_absolute(IntT target, FlowControllerT &flow_controller) { +void call_absolute(IntT target, FlowControllerT &flow_controller) { flow_controller.call(target); } @@ -777,6 +777,18 @@ void call_far(InstructionT &instruction, flow_controller.call(segment, offset); } +template +void int_(uint8_t vector, FlowControllerT &flow_controller) { + flow_controller.interrupt(vector); +} + +template +void into(Status &status, FlowControllerT &flow_controller) { + if(status.flag()) { + flow_controller.interrupt(Interrupt::OnOverflow); + } +} + template void cbw(IntT &ax) { constexpr IntT test_bit = 1 << (sizeof(IntT) * 4 - 1); @@ -926,6 +938,9 @@ template < Primitive::call_far(instruction, flow_controller, registers, memory); return; + case Operation::INT: Primitive::int_(instruction.operand(), flow_controller); return; + case Operation::INTO: Primitive::into(status, flow_controller); return; + case Operation::JO: jcc(status.condition()); return; case Operation::JNO: jcc(!status.condition()); return; case Operation::JB: jcc(status.condition()); return; diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index 8e7b690aa..d9cfb059e 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -365,7 +365,12 @@ struct FailedExecution { // TODO: RET // TODO: JMP // TODO: JCXZ - // TODO: INT, INTO + + // INTO + @"CE.json.gz", + + // INT, INT3 + @"CC.json.gz", @"CD.json.gz", // TODO: LAHF, SAHF // TODO: LDS, LES