1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Added a test for RLD and RRD. Which already passes.

This commit is contained in:
Thomas Harte 2017-07-26 18:56:35 -04:00
parent 6ec4e4e3d7
commit 728143247d

View File

@ -172,10 +172,24 @@ class Z80MemptrTests: XCTestCase {
MEMPTR = rp1_before_operation + 1 MEMPTR = rp1_before_operation + 1
*/ */
/* TODO: // RLD/RRD
RLD/RRD func testRLDRRD() {
MEMPTR = HL + 1 // MEMPTR = HL + 1
*/ let rldProgram: [UInt8] = [
0xed, 0x6f
]
let rrdProgram: [UInt8] = [
0xed, 0x67
]
for addr in 0 ..< 65536 {
let expectedResult = UInt16((addr + 1) & 0xffff)
machine.setValue(UInt16(addr), for: .HL)
XCTAssertEqual(test(program: rldProgram, length: 18, initialValue: 0xffff), expectedResult)
XCTAssertEqual(test(program: rrdProgram, length: 18, initialValue: 0xffff), expectedResult)
}
}
/* TODO: /* TODO:
JR/DJNZ/RET/RETI/RST (jumping to addr) JR/DJNZ/RET/RETI/RST (jumping to addr)