--- nono/debugger/debugger_m88xx0.cpp 2026/04/29 17:05:41 1.1.1.14 +++ nono/debugger/debugger_m88xx0.cpp 2026/04/29 17:05:49 1.1.1.15 @@ -409,7 +409,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 +542,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 +651,7 @@ DebuggerMD_m88xx0::Disassemble(DebuggerM { m88100disasm dis; if (dis.Exec(&mem) == false) { - return "dis.Exec() failed"; + return "dis.Exec() failed."; } // ニーモニック @@ -716,7 +716,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 +727,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 +739,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 +767,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 ""; +}