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

Formalises work left to do.

This commit is contained in:
Thomas Harte 2020-10-06 19:12:19 -04:00
parent 993eff1d3d
commit 9ce9167e3c
2 changed files with 46 additions and 3 deletions

View File

@ -297,11 +297,13 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
case OperationPerform:
switch(active_instruction_->operation) {
case NOP:
break;
//
// Loads, stores and transfers
//
case LDA:
LD(a_, data_buffer_.value, m_masks_);
break;
@ -314,6 +316,14 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
LD(y_, data_buffer_.value, x_masks_);
break;
case PLB:
a_.halves.high = instruction_buffer_.value;
break;
case PLD:
direct_ = ((instruction_buffer_.value) & 0xff) << 16;
break;
case TXS:
// TODO: does this transfer in full when in 8-bit index mode?
LD(s_, x_.full, x_masks_);
@ -324,12 +334,30 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
data_buffer_.size = 2 - m_flag();
break;
case STZ:
data_buffer_.value = 0;
data_buffer_.size = 2 - m_flag();
break;
case STX:
data_buffer_.value = x_.full & x_masks_[1];
data_buffer_.size = 2 - x_flag();
break;
case STY:
data_buffer_.value = y_.full & x_masks_[1];
data_buffer_.size = 2 - m_flag();
break;
//
// Jumps.
//
case JML:
program_bank_ = instruction_buffer_.value & 0xff0000;
[[fallthrough]];
case JMP:
pc_ = instruction_buffer_.value & 0xffff;
break;
@ -415,6 +443,21 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
flags_.set_nz(y_top());
} break;
// TODO:
// ADC, AND, BIT, CMP, CPX, CPY, EOR, ORA, SBC,
// PLP,
// PHB, PHP, PHD, PHK,
// ASL, LSR, ROL, ROR, TRB, TSB,
// REP, SEP,
// BCC, BCS, BEQ, BMI, BNE, BPL, BRA, BVC, BVS, BRL,
// TAX, TAY, TCD, TCS, TDC, TSC, TSX, TXA, TXS, TXY, TYA, TYX,
// XCE, XBA,
// STP, WAI,
// RTI, RTL,
// BRK,
default:
assert(false);
}

View File

@ -149,7 +149,7 @@ enum Operation: uint8_t {
PHB, PHP, PHD, PHK,
// These modify the value in the data buffer as part of a read-modify-write.
ASL, DEC, INC, LSR, ROL, ROR, TRB, TSB,
INC, DEC, ASL, LSR, ROL, ROR, TRB, TSB,
// These merely decrement A, increment or decrement X and Y, and regress
// the program counter only if appropriate.
@ -186,7 +186,7 @@ enum Operation: uint8_t {
JSL,
/// i.e. jump to vector. TODO: is this really distinct from JMP? I'm assuming so for now,
/// as I assume the PBR is implicitly modified. We'll see.
/// as I assume the PBR is implicitly modified. But then is it just JML? We'll see.
BRK,
};