From 6a77ed1e0755c0e9a8ea6957b2c33b680ad26ebe Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 28 Jun 2019 13:53:53 -0400 Subject: [PATCH] Imports SUBI test. --- .../Mac/Clock SignalTests/68000Tests.mm | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/OSBindings/Mac/Clock SignalTests/68000Tests.mm b/OSBindings/Mac/Clock SignalTests/68000Tests.mm index 415b83642..91f45cd9e 100644 --- a/OSBindings/Mac/Clock SignalTests/68000Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000Tests.mm @@ -5129,6 +5129,26 @@ class CPU::MC68000::ProcessorStorageTests { XCTAssertEqual(state.status & Flag::ConditionCodes, 0); } +// MARK: SUBI + +- (void)testSUBIl { + _machine->set_program({ + 0x0481, 0xf111, 0x1111 // SUBI.L #$f1111111, D1 + }); + auto state = _machine->get_processor_state(); + state.data[1] = 0x300021b3; + + _machine->set_processor_state(state); + _machine->run_for_instructions(1); + + state = _machine->get_processor_state(); + XCTAssertEqual(16, _machine->get_cycle_count()); + XCTAssertEqual(state.data[1], 0x3eef10a2); + XCTAssertEqual(state.status & Flag::ConditionCodes, Flag::Carry | Flag::Extend); +} + +// Test of SUBI.W #$7aaa, ($3000).W omitted; that doesn't appear to be a valid instruction? + // MARK: SUBQ - (void)testSUBQl {