2018-08-18 23:18:08 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// Uses some information from:
|
|
|
|
// http://www.cpu-world.com/Arch/6809.html
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
#include <Bus.h>
|
|
|
|
#include <BigEndianProcessor.h>
|
2018-08-26 12:07:26 +00:00
|
|
|
#include <Signal.h>
|
|
|
|
#include <Register.h>
|
2018-08-18 23:18:08 +00:00
|
|
|
|
|
|
|
namespace EightBit {
|
|
|
|
class mc6809 : public BigEndianProcessor {
|
|
|
|
public:
|
|
|
|
enum StatusBits {
|
2018-08-19 09:39:41 +00:00
|
|
|
|
|
|
|
// Entire flag: set if the complete machine state was saved in the stack.
|
|
|
|
// If this bit is not set then only program counter and condition code
|
|
|
|
// registers were saved in the stack. This bit is used by interrupt
|
|
|
|
// handling routines only.
|
|
|
|
// The bit is cleared by fast interrupts, and set by all other interrupts.
|
|
|
|
EF = Bit7,
|
|
|
|
|
|
|
|
// Fast interrupt mask: set if the FIRQ interrupt is disabled.
|
|
|
|
FF = Bit6,
|
|
|
|
|
|
|
|
// Half carry: set if there was a carry from bit 3 to bit 4 of the result
|
|
|
|
// during the last add operation.
|
|
|
|
HF = Bit5,
|
|
|
|
|
|
|
|
// Interrupt mask: set if the IRQ interrupt is disabled.
|
|
|
|
IF = Bit4,
|
|
|
|
|
|
|
|
// Negative: set if the most significant bit of the result is set.
|
|
|
|
// This bit can be set not only by arithmetic and logical operations,
|
|
|
|
// but also by load / store operations.
|
|
|
|
NF = Bit3,
|
|
|
|
|
|
|
|
// Zero: set if the result is zero. Like the N bit, this bit can be
|
|
|
|
// set not only by arithmetic and logical operations, but also
|
|
|
|
// by load / store operations.
|
|
|
|
ZF = Bit2,
|
|
|
|
|
|
|
|
// Overflow: set if there was an overflow during last result calculation.
|
|
|
|
// Logical, load and store operations clear this bit.
|
|
|
|
VF = Bit1,
|
|
|
|
|
|
|
|
// Carry: set if there was a carry from the bit 7 during last add
|
|
|
|
// operation, or if there was a borrow from last subtract operation,
|
|
|
|
// or if bit 7 of the A register was set during last MUL operation.
|
|
|
|
CF = Bit0,
|
2018-08-18 23:18:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
mc6809(Bus& bus);
|
|
|
|
|
|
|
|
Signal<mc6809> ExecutingInstruction;
|
|
|
|
Signal<mc6809> ExecutedInstruction;
|
|
|
|
|
|
|
|
virtual int execute(uint8_t opcode) final;
|
|
|
|
virtual int step() final;
|
|
|
|
|
2018-08-26 16:27:50 +00:00
|
|
|
virtual void powerOn() final;
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
auto& D() { return m_d; }
|
|
|
|
auto& A() { return D().high; }
|
|
|
|
auto& B() { return D().low; }
|
2018-08-18 23:18:08 +00:00
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
auto& X() { return m_x; }
|
|
|
|
auto& Y() { return m_y; }
|
|
|
|
auto& U() { return m_u; }
|
|
|
|
auto& S() { return m_s; }
|
2018-08-18 23:18:08 +00:00
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
auto& DP() { return m_dp; }
|
|
|
|
auto& CC() { return m_cc; }
|
|
|
|
const auto& CC() const { return m_cc; }
|
2018-08-18 23:18:08 +00:00
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
auto& NMI() { return m_nmiLine; } // In
|
|
|
|
auto& FIRQ() { return m_firqLine; } // In
|
2018-08-18 23:18:08 +00:00
|
|
|
|
2018-08-26 18:02:41 +00:00
|
|
|
// |---------------|-----------------------------------|
|
|
|
|
// | MPU State | |
|
|
|
|
// |_______________| MPU State Definition |
|
|
|
|
// | BA | BS | |
|
|
|
|
// |_______|_______|___________________________________|
|
|
|
|
// | 0 | 0 | Normal (running) |
|
|
|
|
// | 0 | 1 | Interrupt or RESET Acknowledge |
|
|
|
|
// | 1 | 0 | SYNC Acknowledge |
|
|
|
|
// | 1 | 1 | HALT Acknowledge |
|
|
|
|
// |-------|-------|-----------------------------------|
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
auto& BA() { return m_baLine; } // Out
|
|
|
|
auto& BS() { return m_bsLine; } // Out
|
2018-08-25 13:55:57 +00:00
|
|
|
|
2018-08-18 23:18:08 +00:00
|
|
|
protected:
|
2018-08-25 00:34:30 +00:00
|
|
|
// Default push/pop handlers
|
2018-08-18 23:18:08 +00:00
|
|
|
|
2018-11-25 19:02:11 +00:00
|
|
|
virtual void push(uint8_t value) final;
|
|
|
|
virtual uint8_t pop() final;
|
2018-08-21 23:34:16 +00:00
|
|
|
|
2018-08-25 00:34:30 +00:00
|
|
|
// Interrupt (etc.) handlers
|
|
|
|
|
|
|
|
virtual void handleRESET() final;
|
2018-08-25 11:09:26 +00:00
|
|
|
virtual void handleIRQ() final;
|
2018-08-25 00:34:30 +00:00
|
|
|
|
2018-08-18 23:18:08 +00:00
|
|
|
private:
|
2018-08-20 10:52:09 +00:00
|
|
|
const uint8_t RESETvector = 0xfe; // RESET vector
|
|
|
|
const uint8_t NMIvector = 0xfc; // NMI vector
|
|
|
|
const uint8_t SWIvector = 0xfa; // SWI vector
|
|
|
|
const uint8_t IRQvector = 0xf8; // IRQ vector
|
|
|
|
const uint8_t FIRQvector = 0xf6; // FIRQ vector
|
|
|
|
const uint8_t SWI2vector = 0xf4; // SWI2 vector
|
|
|
|
const uint8_t SWI3vector = 0xf2; // SWI3 vector
|
|
|
|
const uint8_t RESERVEDvector = 0xf0; // RESERVED vector
|
|
|
|
|
2018-08-21 23:34:16 +00:00
|
|
|
// Stack manipulation
|
|
|
|
|
|
|
|
void push(register16_t& stack, uint8_t value);
|
2018-10-27 20:55:54 +00:00
|
|
|
void pushS(const uint8_t value) { push(S(), value); }
|
|
|
|
void pushU(const uint8_t value) { push(U(), value); }
|
2018-08-21 23:34:16 +00:00
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void pushWord(register16_t& stack, const register16_t value) {
|
2018-08-21 23:34:16 +00:00
|
|
|
push(stack, value.low);
|
|
|
|
push(stack, value.high);
|
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void pushWordS(const register16_t value) { pushWord(S(), value); }
|
|
|
|
void pushWordU(const register16_t value) { pushWord(U(), value); }
|
2018-08-21 23:34:16 +00:00
|
|
|
|
|
|
|
uint8_t pop(register16_t& stack);
|
|
|
|
uint8_t popS() { return pop(S()); }
|
|
|
|
uint8_t popU() { return pop(U()); }
|
|
|
|
|
|
|
|
register16_t popWord(register16_t& stack) {
|
|
|
|
const auto high = pop(stack);
|
|
|
|
const auto low = pop(stack);
|
2018-10-27 20:55:54 +00:00
|
|
|
return { low, high };
|
2018-08-21 23:34:16 +00:00
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
auto popWordS() { return popWord(S()); }
|
|
|
|
auto popWordU() { return popWord(U()); }
|
2018-08-25 00:34:30 +00:00
|
|
|
|
|
|
|
// Interrupt (etc.) handlers
|
|
|
|
|
2018-08-25 13:55:57 +00:00
|
|
|
void handleHALT();
|
2018-08-25 11:09:26 +00:00
|
|
|
void handleNMI();
|
2018-08-25 00:34:30 +00:00
|
|
|
void handleFIRQ();
|
2018-08-21 23:34:16 +00:00
|
|
|
|
2018-08-20 10:52:09 +00:00
|
|
|
// Execution helpers
|
|
|
|
|
2018-08-24 09:49:13 +00:00
|
|
|
void executeUnprefixed(uint8_t opcode);
|
|
|
|
void execute10(uint8_t opcode);
|
|
|
|
void execute11(uint8_t opcode);
|
2018-08-18 23:18:08 +00:00
|
|
|
|
2018-08-19 09:39:41 +00:00
|
|
|
// Register selection for "indexed"
|
|
|
|
register16_t& RR(int which);
|
|
|
|
|
2018-08-21 13:51:56 +00:00
|
|
|
// Register selection for 8-bit transfer/exchange
|
|
|
|
uint8_t& referenceTransfer8(int specifier);
|
|
|
|
|
|
|
|
// Register selection for 16-bit transfer/exchange
|
|
|
|
register16_t& referenceTransfer16(int specifier);
|
|
|
|
|
2018-08-19 09:39:41 +00:00
|
|
|
// Addressing modes
|
2018-08-20 10:52:09 +00:00
|
|
|
|
2018-08-22 22:06:36 +00:00
|
|
|
register16_t Address_direct(); // DP + fetched offset
|
|
|
|
register16_t Address_indexed(); // Indexed address, complicated!
|
|
|
|
register16_t Address_extended(); // Fetched address
|
|
|
|
register16_t Address_relative_byte(); // PC + fetched byte offset
|
|
|
|
register16_t Address_relative_word(); // PC + fetched word offset
|
2018-08-19 09:39:41 +00:00
|
|
|
|
|
|
|
// Addressing mode readers
|
2018-08-20 10:52:09 +00:00
|
|
|
|
|
|
|
// Single byte readers
|
|
|
|
|
2018-08-19 11:58:44 +00:00
|
|
|
uint8_t AM_immediate_byte();
|
|
|
|
uint8_t AM_direct_byte();
|
|
|
|
uint8_t AM_indexed_byte();
|
|
|
|
uint8_t AM_extended_byte();
|
|
|
|
|
2018-08-20 10:52:09 +00:00
|
|
|
// Word readers
|
|
|
|
|
2018-08-19 11:58:44 +00:00
|
|
|
register16_t AM_immediate_word();
|
|
|
|
register16_t AM_direct_word();
|
|
|
|
register16_t AM_indexed_word();
|
|
|
|
register16_t AM_extended_word();
|
2018-08-18 23:55:59 +00:00
|
|
|
|
2018-08-20 10:52:09 +00:00
|
|
|
// Flag adjustment
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
template<class T> void adjustZero(const T datum) { clearFlag(CC(), ZF, datum); }
|
|
|
|
void adjustZero(const register16_t datum) { clearFlag(CC(), ZF, datum.word); }
|
|
|
|
void adjustNegative(const uint8_t datum) { setFlag(CC(), NF, datum & Bit7); }
|
|
|
|
void adjustNegative(const uint16_t datum) { setFlag(CC(), NF, datum & Bit15); }
|
|
|
|
void adjustNegative(const register16_t datum) { adjustNegative(datum.word); }
|
2018-08-20 10:52:09 +00:00
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
template<class T> void adjustNZ(const T datum) {
|
2018-08-19 15:18:06 +00:00
|
|
|
adjustZero(datum);
|
|
|
|
adjustNegative(datum);
|
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustCarry(const uint16_t datum) { setFlag(CC(), CF, datum & Bit8); } // 8-bit addition
|
|
|
|
void adjustCarry(const uint32_t datum) { setFlag(CC(), CF, datum & Bit16); } // 16-bit addition
|
|
|
|
void adjustCarry(const register16_t datum) { adjustCarry(datum.word); }
|
2018-08-20 10:52:09 +00:00
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustBorrow(const uint16_t datum) { clearFlag(CC(), CF, datum & Bit8); } // 8-bit subtraction
|
|
|
|
void adjustBorrow(const uint32_t datum) { clearFlag(CC(), CF, datum & Bit16); } // 16-bit subtraction
|
|
|
|
void adjustBorrow(const register16_t datum) { adjustBorrow(datum.word); }
|
2018-08-20 10:52:09 +00:00
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustOverflow(const uint8_t before, const uint8_t data, const register16_t after) {
|
2018-10-14 20:19:03 +00:00
|
|
|
const uint8_t lowAfter = after.low;
|
|
|
|
const uint8_t highAfter = after.high;
|
|
|
|
setFlag(CC(), VF, (before ^ data ^ lowAfter ^ (highAfter << 7)) & Bit7);
|
2018-08-20 10:52:09 +00:00
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustOverflow(const uint16_t before, const uint16_t data, const uint32_t after) {
|
2018-10-14 20:19:03 +00:00
|
|
|
const uint16_t lowAfter = after & Mask16;
|
|
|
|
const uint16_t highAfter = after >> 16;
|
|
|
|
setFlag(CC(), VF, (before ^ data ^ lowAfter ^ (highAfter << 15)) & Bit15);
|
2018-08-20 10:52:09 +00:00
|
|
|
}
|
2018-10-07 08:14:30 +00:00
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustOverflow(const register16_t before, const register16_t data, const register16_t after) {
|
2018-08-21 19:50:43 +00:00
|
|
|
adjustOverflow(before.word, data.word, after.word);
|
|
|
|
}
|
2018-08-20 10:52:09 +00:00
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustHalfCarry(const uint8_t before, const uint8_t data, const uint8_t after) {
|
2018-10-14 22:18:13 +00:00
|
|
|
setFlag(CC(), HF, (before ^ data ^ after) & Bit4);
|
2018-10-07 08:14:30 +00:00
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustAddition(const uint8_t before, const uint8_t data, const register16_t after) {
|
2018-08-20 21:18:41 +00:00
|
|
|
const auto result = after.low;
|
|
|
|
adjustNZ(result);
|
2018-08-21 19:50:43 +00:00
|
|
|
adjustCarry(after);
|
2018-10-14 20:19:03 +00:00
|
|
|
adjustOverflow(before, data, after);
|
2018-10-07 08:14:30 +00:00
|
|
|
adjustHalfCarry(before, data, result);
|
2018-08-20 21:18:41 +00:00
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustAddition(const uint16_t before, const uint16_t data, const uint32_t after) {
|
2018-08-20 21:18:41 +00:00
|
|
|
const register16_t result = after & Mask16;
|
2018-08-21 19:50:43 +00:00
|
|
|
adjustNZ(result);
|
2018-08-20 21:18:41 +00:00
|
|
|
adjustCarry(after);
|
2018-10-14 20:19:03 +00:00
|
|
|
adjustOverflow(before, data, after);
|
2018-08-21 19:50:43 +00:00
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustAddition(const register16_t before, const register16_t data, const uint32_t after) {
|
2018-08-21 19:50:43 +00:00
|
|
|
adjustAddition(before.word, data.word, after);
|
2018-08-20 21:18:41 +00:00
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustSubtraction(const uint8_t before, const uint8_t data, const register16_t after) {
|
2018-08-20 21:18:41 +00:00
|
|
|
const auto result = after.low;
|
|
|
|
adjustNZ(result);
|
2018-10-14 19:40:20 +00:00
|
|
|
adjustCarry(after);
|
2018-10-14 20:19:03 +00:00
|
|
|
adjustOverflow(before, data, after);
|
2018-08-20 21:18:41 +00:00
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustSubtraction(const uint16_t before, const uint16_t data, const uint32_t after) {
|
2018-08-20 21:18:41 +00:00
|
|
|
const register16_t result = after & Mask16;
|
2018-08-21 19:50:43 +00:00
|
|
|
adjustNZ(result);
|
2018-10-14 19:40:20 +00:00
|
|
|
adjustCarry(after);
|
2018-10-14 20:19:03 +00:00
|
|
|
adjustOverflow(before, data, after);
|
2018-08-21 19:50:43 +00:00
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void adjustSubtraction(const register16_t before, const register16_t data, const uint32_t after) {
|
2018-08-21 19:50:43 +00:00
|
|
|
adjustSubtraction(before.word, data.word, after);
|
2018-08-20 21:18:41 +00:00
|
|
|
}
|
|
|
|
|
2018-08-22 22:06:36 +00:00
|
|
|
// Flag checking
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
auto fastInterruptMasked() const { return CC() & FF; }
|
|
|
|
auto interruptMasked() const { return CC() & IF; }
|
2018-09-22 09:54:05 +00:00
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
auto negative() const { return CC() & NF; }
|
|
|
|
auto zero() const { return CC() & ZF; }
|
|
|
|
auto overflow() const { return CC() & VF; }
|
|
|
|
auto carry() const { return CC() & CF; }
|
|
|
|
auto halfCarry() const { return CC() & HF; }
|
2018-08-22 22:06:36 +00:00
|
|
|
|
2018-11-10 20:31:14 +00:00
|
|
|
auto LS() const { return carry() || zero(); } // (C OR Z)
|
2018-10-27 20:55:54 +00:00
|
|
|
auto HI() const { return !LS(); } // !(C OR Z)
|
|
|
|
auto LT() const { return (negative() >> 3) ^ (overflow() >> 1); } // (N XOR V)
|
|
|
|
auto GE() const { return !LT(); } // !(N XOR V)
|
2018-11-10 20:31:14 +00:00
|
|
|
auto LE() const { return zero() || LT(); } // (Z OR (N XOR V))
|
2018-10-27 20:55:54 +00:00
|
|
|
auto GT() const { return !LE(); } // !(Z OR (N XOR V))
|
2018-08-22 22:06:36 +00:00
|
|
|
|
|
|
|
// Branching
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
auto branch(const register16_t destination, const int condition) {
|
2018-08-22 22:06:36 +00:00
|
|
|
if (condition)
|
|
|
|
jump(destination);
|
|
|
|
return !!condition;
|
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void branchShort(const int condition) {
|
2018-09-22 09:54:05 +00:00
|
|
|
branch(Address_relative_byte(), condition);
|
2018-08-22 22:06:36 +00:00
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
void branchLong(const int condition) {
|
2018-09-22 09:54:05 +00:00
|
|
|
if (branch(Address_relative_word(), condition))
|
|
|
|
addCycle();
|
2018-08-22 22:06:36 +00:00
|
|
|
}
|
|
|
|
|
2018-08-23 13:09:46 +00:00
|
|
|
// Miscellaneous
|
|
|
|
|
|
|
|
void saveEntireRegisterState();
|
2018-10-18 21:25:52 +00:00
|
|
|
void savePartialRegisterState();
|
|
|
|
void saveRegisterState();
|
|
|
|
void restoreRegisterState();
|
2018-08-23 13:09:46 +00:00
|
|
|
|
2018-10-18 21:25:52 +00:00
|
|
|
template <class T> T through(const T data) {
|
|
|
|
clearFlag(CC(), VF);
|
|
|
|
adjustNZ(data);
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
2018-10-27 20:55:54 +00:00
|
|
|
// Instruction implementations
|
|
|
|
|
2018-10-18 21:25:52 +00:00
|
|
|
template <class T> T ld(const T data) {
|
|
|
|
return through(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class T> T st(const T data) {
|
|
|
|
return through(data);
|
|
|
|
}
|
|
|
|
|
2018-08-19 09:15:37 +00:00
|
|
|
uint8_t adc(uint8_t operand, uint8_t data);
|
2018-10-14 19:40:20 +00:00
|
|
|
uint8_t add(uint8_t operand, uint8_t data, uint8_t carry = 0);
|
2018-08-19 11:58:44 +00:00
|
|
|
register16_t add(register16_t operand, register16_t data);
|
2018-08-19 13:08:49 +00:00
|
|
|
uint8_t andr(uint8_t operand, uint8_t data);
|
2018-08-19 15:18:06 +00:00
|
|
|
uint8_t asl(uint8_t operand);
|
|
|
|
uint8_t asr(uint8_t operand);
|
2018-10-31 23:29:13 +00:00
|
|
|
void bit(uint8_t operand, uint8_t data);
|
2018-08-19 16:03:32 +00:00
|
|
|
uint8_t clr();
|
2018-08-20 10:52:09 +00:00
|
|
|
void cmp(uint8_t operand, uint8_t data);
|
|
|
|
void cmp(register16_t operand, register16_t data);
|
2018-08-21 08:01:15 +00:00
|
|
|
uint8_t com(uint8_t operand);
|
2018-08-21 08:52:03 +00:00
|
|
|
void cwai(uint8_t data);
|
2018-08-21 11:25:58 +00:00
|
|
|
uint8_t da(uint8_t operand);
|
2018-08-21 12:29:52 +00:00
|
|
|
uint8_t dec(uint8_t operand);
|
2018-10-31 23:29:13 +00:00
|
|
|
uint8_t eorr(uint8_t operand, uint8_t data);
|
2018-08-21 13:51:56 +00:00
|
|
|
void exg(uint8_t data);
|
2018-08-21 16:01:20 +00:00
|
|
|
uint8_t inc(uint8_t operand);
|
2018-08-29 13:03:24 +00:00
|
|
|
void jsr(register16_t address);
|
2018-08-21 20:59:25 +00:00
|
|
|
uint8_t lsr(uint8_t operand);
|
2018-08-21 21:45:33 +00:00
|
|
|
register16_t mul(uint8_t first, uint8_t second);
|
2018-08-18 23:55:59 +00:00
|
|
|
uint8_t neg(uint8_t operand);
|
2018-08-21 22:07:22 +00:00
|
|
|
uint8_t orr(uint8_t operand, uint8_t data);
|
2018-09-20 23:28:08 +00:00
|
|
|
void psh(register16_t& stack, uint8_t data);
|
|
|
|
void pul(register16_t& stack, uint8_t data);
|
2018-08-22 08:11:02 +00:00
|
|
|
uint8_t rol(uint8_t operand);
|
|
|
|
uint8_t ror(uint8_t operand);
|
2018-08-22 09:21:22 +00:00
|
|
|
void rti();
|
|
|
|
void rts();
|
2018-08-23 23:14:44 +00:00
|
|
|
uint8_t sbc(uint8_t operand, uint8_t data);
|
2018-10-14 19:40:20 +00:00
|
|
|
uint8_t sub(uint8_t operand, uint8_t data, uint8_t carry = 0);
|
2018-08-23 23:14:44 +00:00
|
|
|
register16_t sub(register16_t operand, register16_t data);
|
2018-08-23 13:09:46 +00:00
|
|
|
uint8_t sex(uint8_t from);
|
|
|
|
void swi();
|
|
|
|
void swi2();
|
|
|
|
void swi3();
|
|
|
|
void tfr(uint8_t data);
|
2018-08-23 23:33:18 +00:00
|
|
|
void tst(uint8_t data);
|
2018-08-18 23:18:08 +00:00
|
|
|
|
|
|
|
register16_t m_d;
|
|
|
|
register16_t m_x;
|
|
|
|
register16_t m_y;
|
|
|
|
register16_t m_u;
|
|
|
|
register16_t m_s;
|
|
|
|
|
|
|
|
uint8_t m_dp;
|
|
|
|
uint8_t m_cc;
|
|
|
|
|
2018-08-25 11:09:26 +00:00
|
|
|
PinLevel m_nmiLine = Low;
|
|
|
|
PinLevel m_firqLine = Low;
|
2018-08-20 10:52:09 +00:00
|
|
|
|
2018-08-25 13:55:57 +00:00
|
|
|
PinLevel m_baLine = Low;
|
|
|
|
PinLevel m_bsLine = Low;
|
|
|
|
|
2018-08-20 10:52:09 +00:00
|
|
|
bool m_prefix10 = false;
|
|
|
|
bool m_prefix11 = false;
|
2018-08-18 23:18:08 +00:00
|
|
|
};
|
|
|
|
}
|