1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 03:32:01 +00:00

Added failing tests for both kinds of CALL.

This commit is contained in:
Thomas Harte 2017-06-19 22:03:29 -04:00
parent e05076b258
commit 6752f165db

View File

@ -980,7 +980,47 @@ class Z80MachineCycleTests: XCTestCase {
)
}
// TODO: CALL
// CALL
func testCALL() {
test(
program: [0xcd, 0x00, 0x80],
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: 3),
MachineCycle(operation: .readOpcode, length: 4),
]
)
}
// CALL cc
func testCALLcc() {
test(
program: [
0x37, // SCF
0xd4, // CALL NC
0xdc, // CALL C
],
busCycles: [
MachineCycle(operation: .readOpcode, length: 4),
MachineCycle(operation: .readOpcode, length: 4),
MachineCycle(operation: .read, length: 3),
MachineCycle(operation: .read, length: 3),
MachineCycle(operation: .readOpcode, length: 4),
MachineCycle(operation: .read, length: 3),
MachineCycle(operation: .read, length: 4),
MachineCycle(operation: .write, length: 3),
MachineCycle(operation: .write, length: 3),
MachineCycle(operation: .readOpcode, length: 4),
]
)
}
// RET
func testRET() {