#include "M68000Instruction.h" #ifndef __M68000_Bcc_H__ #define __M68000_Bcc_H__ namespace M68000 { class Bcc :public M68000Instruction { public: virtual Bcc* Clone() const {return new Bcc();} virtual Bcc* ClonePlacement(void* buffer) const {return new(buffer) Bcc();} virtual size_t GetOpcodeClassByteSize() const {return sizeof(*this);} virtual bool RegisterOpcode(OpcodeTable& table) const { return table.AllocateRegionToOpcode(this, L"0110CCCC********", L"CCCC=0010-1111"); } virtual std::wstring GetOpcodeName() const { return L"Bcc"; } virtual Disassembly M68000Disassemble(const M68000::LabelSubstitutionSettings& labelSettings) const { if (labelSettings.enableSubstitution) { return Disassembly(L"B" + DisassembleConditionCode(_conditionCode) + L"." + DisassembleSize(_size), _target.DisassembleImmediateAsPCDisplacement(labelSettings)); } else { return Disassembly(L"B" + DisassembleConditionCode(_conditionCode) + L"." + DisassembleSize(_size), _target.DisassembleImmediateAsPCDisplacement(labelSettings), _target.DisassembleImmediateAsPCDisplacementTargetAddressString()); } } virtual void M68000Decode(M68000* cpu, const M68000Long& location, const M68000Word& data, bool transparent) { // ----------------------------------------------------------------- // |15 |14 |13 |12 |11 |10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | // |---|---|---|---|---------------|-------------------------------| // | 0 | 1 | 1 | 0 | CONDITION | 8 BITS OFFSET | // |---------------------------------------------------------------| // | 16 BITS OFFSET, IF 8 BITS OFFSET = $00 | // ----------------------------------------------------------------- _conditionCode = (ConditionCode)data.GetDataSegment(8, 4); // Bcc