1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Find first failing execution, note reason.

This commit is contained in:
Thomas Harte 2023-10-06 11:43:18 -04:00
parent 2d17d9d316
commit 82f0cd790f
2 changed files with 14 additions and 6 deletions

View File

@ -118,10 +118,15 @@ inline void aam(CPU::RegisterPair16 &ax, uint8_t imm, Status &status) {
The SF, ZF, and PF flags are set according to the result.
The OF, AF, and CF flags are undefined.
*/
/*
If ... an immediate value of 0 is used, it will cause a #DE (divide error) exception.
*/
ax.halves.high = ax.halves.low / imm;
ax.halves.low = ax.halves.low % imm;
status.sign = ax.halves.low & 0x80;
status.parity = status.zero = ax.halves.low;
// TODO: #DE.
}
inline void aas(CPU::RegisterPair16 &ax, Status &status) {

View File

@ -315,20 +315,23 @@ struct FlowController {
if(assert) {
XCTAssert(
statusEqual,
"Status doesn't match — differs in %02x after %@",
"Status doesn't match — differs in %02x after %@; executing %@",
intended_status.get() ^ status.get(),
test[@"name"]
test[@"name"],
[self toString:decoded.second offsetLength:4 immediateLength:4]
);
// TODO: should probably say more about the following two.
XCTAssert(
registersEqual,
"Register mismatch after %@",
test[@"name"]
"Register mismatch after %@; executing %@",
test[@"name"],
[self toString:decoded.second offsetLength:4 immediateLength:4]
);
XCTAssert(
ramEqual,
"Memory contents mismatch after %@",
test[@"name"]
"Memory contents mismatch after %@; executing %@",
test[@"name"],
[self toString:decoded.second offsetLength:4 immediateLength:4]
);
}