mirror of
https://github.com/TomHarte/CLK.git
synced 2025-03-23 07:34:20 +00:00
Fix Bcc, making decision that add_pc
is relative to start of instruction.
This commit is contained in:
parent
90f0005cf2
commit
5a87506f3d
InstructionSets/M68k/Implementation
OSBindings/Mac/Clock SignalTests
@ -361,7 +361,7 @@ void Executor<model, BusHandler>::set_pc(uint32_t address) {
|
||||
|
||||
template <Model model, typename BusHandler>
|
||||
void Executor<model, BusHandler>::add_pc(uint32_t offset) {
|
||||
program_counter_.l += offset;
|
||||
program_counter_.l = instruction_address_ + offset;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ template <
|
||||
// is the trailing step of a BSR.
|
||||
case Operation::Bccb:
|
||||
if(status.evaluate_condition(instruction.condition())) {
|
||||
flow_controller.add_pc(int8_t(src.b) - 2);
|
||||
flow_controller.add_pc(int8_t(src.b) + 2);
|
||||
} else {
|
||||
flow_controller.decline_branch();
|
||||
}
|
||||
@ -288,7 +288,7 @@ template <
|
||||
|
||||
case Operation::Bccw:
|
||||
if(status.evaluate_condition(instruction.condition())) {
|
||||
flow_controller.add_pc(int16_t(src.b) - 2);
|
||||
flow_controller.add_pc(int16_t(src.w) + 2);
|
||||
} else {
|
||||
flow_controller.decline_branch();
|
||||
}
|
||||
@ -296,7 +296,7 @@ template <
|
||||
|
||||
case Operation::Bccl:
|
||||
if(status.evaluate_condition(instruction.condition())) {
|
||||
flow_controller.add_pc(src.l - 2);
|
||||
flow_controller.add_pc(src.l + 2);
|
||||
} else {
|
||||
flow_controller.decline_branch();
|
||||
}
|
||||
@ -312,7 +312,7 @@ template <
|
||||
flow_controller.decline_branch();
|
||||
} else {
|
||||
// Take the branch.
|
||||
flow_controller.add_pc(int16_t(dest.l) - 2);
|
||||
flow_controller.add_pc(int16_t(dest.l) + 2);
|
||||
}
|
||||
} else {
|
||||
// This DBcc will be ignored as the condition is true.
|
||||
|
@ -39,7 +39,7 @@
|
||||
- (void)setUp {
|
||||
// To limit tests run to a subset of files and/or of tests, uncomment and fill in below.
|
||||
_fileSet = [NSSet setWithArray:@[@"bcc.json"]];
|
||||
// _testSet = [NSSet setWithArray:@[@"ADDQ 00d0"]];
|
||||
// _testSet = [NSSet setWithArray:@[@"Bcc 6000 [0]"]];
|
||||
// _fileSet = [NSSet setWithArray:@[@"jmp_jsr.json"]];
|
||||
// _testSet = [NSSet setWithArray:@[@"CHK 41a8"]];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user