1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-25 16:31:42 +00:00

Add MOVEA, be slightly more careful about next_operand_.

This commit is contained in:
Thomas Harte 2022-05-24 11:30:09 -04:00
parent 4b07c41df9
commit a7e8aef9d3
2 changed files with 11 additions and 8 deletions

View File

@ -20,7 +20,7 @@ namespace MC68000Mk2 {
// TODO: BERR, interrupt inputs, etc; and obeying the trace flag.
// Also, from Instruction.hpp:
//
// MOVEAw, MOVEAl
// TRAP, TRAPV
//
// Not provided by a 68000: Bccl, BSRl
@ -585,7 +585,9 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
StdCASE(EXTwtol, perform_state_ = Perform_np);
StdCASE(MOVEb, perform_state_ = MOVE);
Duplicate(MOVEAw, MOVEw)
StdCASE(MOVEw, perform_state_ = MOVE);
Duplicate(MOVEAl, MOVEl)
StdCASE(MOVEl, perform_state_ = MOVE);
StdCASE(CMPb, perform_state_ = Perform_np);
@ -814,12 +816,10 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
StdCASE(LEA, {
post_ea_state_ = LEA;
next_operand_ = 0;
MoveToStateSpecific(CalcEffectiveAddress);
});
StdCASE(PEA, {
post_ea_state_ = PEA;
next_operand_ = 0;
MoveToStateSpecific(CalcEffectiveAddress);
});
@ -830,7 +830,6 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
// for the other cases.
if(instruction_.mode(0) != Mode::DataRegisterDirect) {
post_ea_state_ = TAS;
next_operand_ = 0;
MoveToStateSpecific(CalcEffectiveAddress);
}
@ -1440,8 +1439,12 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
// Various generic forms of perform.
//
#define MoveToWritePhase() \
if(operand_flags_ & 0x0c) { \
next_operand_ = 0; \
if(operand_flags_ & 0x0c) MoveToStateSpecific(StoreOperand) else MoveToStateSpecific(Decode)
MoveToStateSpecific(StoreOperand); \
} else { \
MoveToStateSpecific(Decode); \
}
BeginState(Perform_np):
PerformDynamic();

View File

@ -87,7 +87,7 @@ struct ProcessorBase: public InstructionSet::M68k::NullFlowController {
/// When fetching or storing operands, this is the next one to fetch
/// or store.
int next_operand_ = 0;
int next_operand_ = -1;
/// Storage for a temporary address, which can't be a local because it'll
/// be used to populate microcycles, which may persist beyond an entry