1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-29 16:55:59 +00:00

Added tests for EXX, EX (SP), HL and EX (SP), IX. The latter two currently being incorrect.

This commit is contained in:
Thomas Harte 2017-06-19 19:17:54 -04:00
parent 002098d496
commit 8d60734737

View File

@ -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),
]
)
}
}