--- mon/src/mon_cmd.cpp 2007/01/21 17:32:05 1.19 +++ mon/src/mon_cmd.cpp 2012/06/19 22:23:25 1.21 @@ -316,7 +316,9 @@ enum CPUType { CPU_Z80, CPU_80x86_32, CPU_80x86_16, - CPU_x86_64 + CPU_x86_64, + CPU_MIPS, + CPU_MIPS_LITTLE, }; static void disassemble(CPUType type) @@ -360,6 +362,14 @@ static void disassemble(CPUType type) } break; + case CPU_MIPS: + case CPU_MIPS_LITTLE: + while (adr <= end_adr && !mon_aborted()) { + fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); + adr += disass_mips(monout, mon_use_real_mem ? adr : adr % mon_mem_size, type == CPU_MIPS_LITTLE); + } + break; + case CPU_x86_64: while (adr <= end_adr && !mon_aborted()) { fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size); @@ -419,6 +429,16 @@ void disassemble_x86_64(void) disassemble(CPU_x86_64); } +void disassemble_mips(void) +{ + disassemble(CPU_MIPS); +} + +void disassemble_mipsel(void) +{ + disassemble(CPU_MIPS_LITTLE); +} + /* * Modify memory @@ -460,8 +480,10 @@ void fill(void) if (!byte_string(str, len)) return; - while (adr <= end_adr) - mon_write_byte(adr++, str[src_adr++ % len]); + if (len) { + while (adr <= end_adr) + mon_write_byte(adr++, str[src_adr++ % len]); + } free(str); }