--- nono/m680x0/m68030disasm.cpp 2026/04/29 17:04:34 1.1.1.2 +++ nono/m680x0/m68030disasm.cpp 2026/04/29 17:05:22 1.1.1.8 @@ -5,12 +5,10 @@ // #include "m68030disasm.h" -#include "bus.h" -#include "mystring.h" +#include "debugger_memory.h" // コンストラクタ -m680x0disasm::m680x0disasm(DebuggerMD *m) - : inherited(m) +m680x0disasm::m680x0disasm() { } @@ -21,9 +19,9 @@ m680x0disasm::~m680x0disasm() // 逆アセンブルを実行 bool -m680x0disasm::Exec(saddr_t addr) +m680x0disasm::Exec(DebuggerMemoryStream *mem_) { - ExecInit(); + ExecInit(mem_); ir.clear(); name.clear(); @@ -31,8 +29,7 @@ m680x0disasm::Exec(saddr_t addr) src.clear(); dst.clear(); - pc = addr; - pc0 = pc.addr; + pc0 = (uint32)mem->laddr; switch (fetch16() >> 6) { #include "m68030switch.h" @@ -87,31 +84,16 @@ m680x0disasm::Exec(saddr_t addr) uint32 m680x0disasm::peek16() { - uint64 paddr; - - if (pc.IsLogical() && md->MMUEnabled()) { - paddr = md->TranslateAddr(pc); - if ((int64)paddr < 0) - return 0xffff; - } else { - paddr = pc.addr; - } - - // 物理空間から読み込む - uint16 data; - data = vm_phys_peek_8(paddr) << 8; - data |= vm_phys_peek_8(paddr + 1); - return data; + return mem->Peek(2); } // ワードフェッチ uint32 m680x0disasm::fetch16() { - uint16 data = peek16(); - // IR に入れて PC を進める + uint16 data = mem->Read(2); + // IR にも入れる ir.push_back(data); - pc.addr += 2; return data; } @@ -228,7 +210,7 @@ m680x0disasm::make_ea(uint mmrr) s = addr32(); break; case 0x3a: // d16(pc) - s = addr32(pc.addr + (int32)(int16)fetch16()) + + s = addr32((uint32)mem->laddr + (int32)(int16)fetch16()) + "(" + make_reg(Reg::PC) + ")"; break; case 0x3b: // d8(pc,IX) @@ -616,7 +598,7 @@ m680x0disasm::make_reglist_half(std::str if (top < 0) { // 非表示中ならこのレジスタを出力する。 // 初回以外は区切りを先に出力する。 - if (s.length() != 0) { + if (s.empty() == false) { s += '/'; } s += reg; @@ -671,7 +653,7 @@ m680x0disasm::make_bf() if (width < 8) { s += make_dn(width); } else { - s += string_format("", width); + s += string_format("", width); } } else { // 幅は 0 なら 32 を意味する @@ -865,6 +847,12 @@ m680x0disasm::make_fpnlist() "fpcr", "fpsr", "fpiar", + + "urp", + "itt0", + "itt1", + "dtt0", + "dtt1", }; /*static*/ const char * const m680x0disasm::size_str[] = { @@ -2089,6 +2077,22 @@ OP_DEF(addi_l) dst = make_ea(); } +// %0000_011011_00nnnn RTM Rn +// %0000_011011_mmmrrr CALLM #, +OP_DEF(callm) +{ + uint n = ir[0] & 0x3f; + + if (n < 16) { + name = "rtm"; + src = make_rn(n); + } else { + name = "callm"; + src = imm16(); + dst = make_ea(); + } +} + // BTST,BCHG,BCLR,BSET #, の共通部分。 void m680x0disasm::ops_btst_imm_ea() @@ -2975,9 +2979,13 @@ OP_DEF(addq_l) dst = make_ea(); } -// Scc/SF のメイン部分。 -void -m680x0disasm::ops_scc() +// %0101_cccc11_mmmrrr Scc.B +// %0101_cccc11_001yyy DBcc.W Dy,