1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-02-16 18:30:32 +00:00

Add MOVE to/from USP.

This commit is contained in:
Thomas Harte 2022-05-23 20:42:41 -04:00
parent 34e5f39571
commit 9cac4ca317
2 changed files with 14 additions and 3 deletions

View File

@ -20,7 +20,7 @@ namespace MC68000Mk2 {
// TODO: VPA, BERR, interrupt inputs, etc.
// Also, from Instruction.hpp:
//
// MOVEAw, MOVEAl, MOVE[to/from]USP, STOP
// MOVEAw, MOVEAl, STOP
//
// Not provided by a 68000: Bccl, BSRl
@ -786,6 +786,9 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
SpecialCASE(RESET);
SpecialCASE(NOP);
StdCASE(MOVEtoUSP, perform_state_ = Perform_np);
StdCASE(MOVEfromUSP, perform_state_ = Perform_np);
default:
assert(false);
}
@ -2308,6 +2311,14 @@ inline void ProcessorBase::tas(Preinstruction instruction, uint32_t) {
status_.negative_flag = value & 0x80;
}
inline void ProcessorBase::move_to_usp(uint32_t address) {
stack_pointers_[0].l = address;
}
inline void ProcessorBase::move_from_usp(uint32_t &address) {
address = stack_pointers_[0].l;
}
// MARK: - External state.
template <class BusHandler, bool dtack_is_implicit, bool permit_overrun, bool signal_will_perform>

View File

@ -141,8 +141,8 @@ struct ProcessorBase: public InstructionSet::M68k::NullFlowController {
inline void complete_dbcc(bool, bool, int16_t);
inline void bsr(uint32_t);
inline void stop() {} // TODO
inline void move_to_usp(uint32_t) {} // TODO
inline void move_from_usp(uint32_t &) {} // TODO
inline void move_to_usp(uint32_t);
inline void move_from_usp(uint32_t &);
inline void tas(Preinstruction, uint32_t);
template <bool use_current_instruction_pc = true> void raise_exception(int);