mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-23 03:32:32 +00:00
Added various tests of the basic ALU ops.
This commit is contained in:
parent
ba15371948
commit
23177df26a
@ -556,4 +556,50 @@ class Z80MachineCycleTests: XCTestCase {
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
// ADD A,r
|
||||
func testADDAr() {
|
||||
test(
|
||||
program: [0x80],
|
||||
busCycles: [
|
||||
MachineCycle(operation: .readOpcode, length: 4),
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
// ADD A,n
|
||||
func testADDAn() {
|
||||
test(
|
||||
program: [0xc6, 0x00],
|
||||
busCycles: [
|
||||
MachineCycle(operation: .readOpcode, length: 4),
|
||||
MachineCycle(operation: .read, length: 3),
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
// ADD A,(HL)
|
||||
func testADDAHL() {
|
||||
test(
|
||||
program: [0x86],
|
||||
busCycles: [
|
||||
MachineCycle(operation: .readOpcode, length: 4),
|
||||
MachineCycle(operation: .read, length: 3),
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
// ADD A,(IX+d)
|
||||
func testADDAIXd() {
|
||||
test(
|
||||
program: [0xdd, 0x86],
|
||||
busCycles: [
|
||||
MachineCycle(operation: .readOpcode, length: 4),
|
||||
MachineCycle(operation: .readOpcode, length: 4),
|
||||
MachineCycle(operation: .read, length: 3),
|
||||
MachineCycle(operation: .internalOperation, length: 5),
|
||||
MachineCycle(operation: .read, length: 3),
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user