From 8d60734737c24041fa86345d878e8c2367c51157 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 19 Jun 2017 19:17:54 -0400 Subject: [PATCH] Added tests for EXX, EX (SP), HL and EX (SP), IX. The latter two currently being incorrect. --- .../Z80MachineCycleTests.swift | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/OSBindings/Mac/Clock SignalTests/Z80MachineCycleTests.swift b/OSBindings/Mac/Clock SignalTests/Z80MachineCycleTests.swift index d07d85873..a0ded5457 100644 --- a/OSBindings/Mac/Clock SignalTests/Z80MachineCycleTests.swift +++ b/OSBindings/Mac/Clock SignalTests/Z80MachineCycleTests.swift @@ -429,4 +429,43 @@ class Z80MachineCycleTests: XCTestCase { ] ) } + + // EXX + func testEXX() { + test( + program: [0xd9], + busCycles: [ + MachineCycle(operation: .readOpcode, length: 4), + ] + ) + } + + // EX (SP), HL + func testEXSPHL() { + test( + program: [0xe3], + busCycles: [ + MachineCycle(operation: .readOpcode, length: 4), + MachineCycle(operation: .read, length: 3), + MachineCycle(operation: .read, length: 4), + MachineCycle(operation: .write, length: 3), + MachineCycle(operation: .write, length: 5), + ] + ) + } + + // EX (SP), IX + func testEXSPIX() { + test( + program: [0xdd, 0xe3], + busCycles: [ + MachineCycle(operation: .readOpcode, length: 4), + MachineCycle(operation: .readOpcode, length: 4), + MachineCycle(operation: .read, length: 3), + MachineCycle(operation: .read, length: 4), + MachineCycle(operation: .write, length: 3), + MachineCycle(operation: .write, length: 5), + ] + ) + } }