--- nono/debugger/debugger_m88xx0.cpp 2026/04/29 17:05:28 1.1.1.12 +++ nono/debugger/debugger_m88xx0.cpp 2026/04/29 17:05:58 1.1.1.16 @@ -33,7 +33,6 @@ DebuggerMD_m88xx0::DebuggerMD_m88xx0(Deb // 機種依存変数 inst_bytes = 4; - inst_bytes_fixed = 4; lasize = 32; pasize = 32; name = "mpu"; @@ -329,7 +328,7 @@ DebuggerMD_m88xx0::ShowRegister(FILE *co if (MatchCMMUCmd(args[0], "ra", &cmmu_id)) { Monitor *mon = gMonitorManager->Find(ID_MONITOR_ATC(cmmu_id)); if (mon) { - parent->ShowMonitor(*mon); + parent->ShowMonitor(mon); return true; } goto notfound; @@ -340,7 +339,7 @@ DebuggerMD_m88xx0::ShowRegister(FILE *co if (MatchCMMUCmd(args[0], "rm", &cmmu_id)) { Monitor *mon = gMonitorManager->Find(ID_MONITOR_CMMU(cmmu_id)); if (mon) { - parent->ShowMonitor(*mon); + parent->ShowMonitor(mon); return true; } goto notfound; @@ -409,7 +408,7 @@ r2 :0070e1a0 r10:00000000 r18:00000000 uint32 res = cpu->reg.r[cmp_rd]; for (int b = 11; b >= 2; b--) { s.Print(57 + x * 7, y, "%x:%s=%u", b, cmpstr[b], - (res & (1 << b)) ? 1 : 0); + (res & (1U << b)) ? 1 : 0); x++; if (x > 2) { x = 0; @@ -542,11 +541,11 @@ DebuggerMD_m88xx0::ShowRegCache(FILE *co errno = 0; set = strtol(args[1].c_str(), &end, 16); if (end == &args[1][0] || *end != '\0' || errno == ERANGE) { - fprintf(cons, " must be a number\n"); + fprintf(cons, " must be a number.\n"); goto done; } if (set < 0 || set > 256) { - fprintf(cons, " must be in 00..ff\n"); + fprintf(cons, " must be in 00..ff.\n"); goto done; } ShowRegCacheSet(cmmu, set); @@ -651,7 +650,7 @@ DebuggerMD_m88xx0::Disassemble(DebuggerM { m88100disasm dis; if (dis.Exec(&mem) == false) { - return "dis.Exec() failed"; + return "dis.Exec() failed."; } // ニーモニック @@ -671,12 +670,12 @@ DebuggerMD_m88xx0::Disassemble(DebuggerM const auto& e = brhist->entry[brhist->top]; if (e.from + 4 == cpu->reg.xip) { // 直前の位置にあるブランチが遅延ブランチかどうか調べる - if ((e.inst & 0xfc000000) == 0xf4000000) { + if ((e.info & 0xfc000000) == 0xf4000000) { // jmp, jsr - delay = (e.inst >> 10) & 1; - } else if (0xc0000000 <= e.inst && e.inst < 0xfc000000) { + delay = (e.info >> 10) & 1; + } else if (0xc0000000 <= e.info && e.info < 0xfc000000) { // br, bsr, bcnd - delay = (e.inst >> 26) & 1; + delay = (e.info >> 26) & 1; } } } @@ -716,7 +715,7 @@ DebuggerMD_m88xx0::CondStr(uint32 op) // rS の bit B が %0 ならブランチ/トラップ cmp_rd = -1; uint32 b = m88100opf_B5(op); - TAKE_IF((cpu->reg.r[s] & (1 << b)) == 0); + TAKE_IF((cpu->reg.r[s] & (1U << b)) == 0); } if (IsBB1(op)) { // 11011N BBBBB SSSSS dddddd dd dddddddd bb1 @@ -727,7 +726,7 @@ DebuggerMD_m88xx0::CondStr(uint32 op) return " (nop)"; } uint32 b = m88100opf_B5(op); - TAKE_IF((cpu->reg.r[s] & (1 << b)) != 0); + TAKE_IF((cpu->reg.r[s] & (1U << b)) != 0); } if (IsTB1(op)) { // 111100 BBBBB SSSSS 110110 0V VVVVVVVV tb1 @@ -739,7 +738,7 @@ DebuggerMD_m88xx0::CondStr(uint32 op) return ""; } uint32 b = m88100opf_B5(op); - TAKE_IF((cpu->reg.r[s] & (1 << b)) != 0); + TAKE_IF((cpu->reg.r[s] & (1U << b)) != 0); } if ((op & 0xf8000000) == 0xe8000000 || // bcnd (op & 0xfc00fe00) == 0xf000e800) // tcnd @@ -767,3 +766,13 @@ DebuggerMD_m88xx0::CondStr(uint32 op) return ""; } + +// 命令ニーモニックに対するバイナリを文字列形式で返す。 +// 対応しない場合は "" を返す。cmd_bi 用。 +std::string +DebuggerMD_m88xx0::ParseInst(const std::string& inst) const +{ + if (inst == "rte") return "f400fc00"; + + return ""; +}