mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-24 12:30:05 +00:00
Fixed various bugs in the disassembler
This commit is contained in:
parent
07badbb1b3
commit
81cabc5730
@ -881,7 +881,13 @@ void opc_group31(PPCDisasmContext* ctx)
|
|||||||
|
|
||||||
case 0x12: /* tlb & segment register instructions */
|
case 0x12: /* tlb & segment register instructions */
|
||||||
|
|
||||||
if (index == 6) { /* mtsr */
|
if (index == 4) { /* mtmsr */
|
||||||
|
if ((ra != 0) || (rb != 0) || rc_set)
|
||||||
|
opc_illegal(ctx);
|
||||||
|
else
|
||||||
|
ctx->instr_str = my_sprintf("%-8sr%d", "mtmsr", rs);
|
||||||
|
}
|
||||||
|
else if (index == 6) { /* mtsr */
|
||||||
if (ra & 16)
|
if (ra & 16)
|
||||||
opc_illegal(ctx);
|
opc_illegal(ctx);
|
||||||
else
|
else
|
||||||
@ -1001,7 +1007,12 @@ void opc_group31(PPCDisasmContext* ctx)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (index < 16) {
|
if (index < 16) {
|
||||||
fmt_threeop(ctx->instr_str, opc_idx_ldst[index], rs, ra, rb);
|
if (ra == 0)
|
||||||
|
ctx->instr_str = my_sprintf("%-8sr%d, 0, r%d", opc_idx_ldst[index], rs, rb);
|
||||||
|
else
|
||||||
|
fmt_threeop(ctx->instr_str, opc_idx_ldst[index], rs, ra, rb);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ctx->instr_str = my_sprintf("%-8sf%d, r%d, r%d", \
|
ctx->instr_str = my_sprintf("%-8sf%d, r%d, r%d", \
|
||||||
@ -1148,7 +1159,11 @@ void opc_group31(PPCDisasmContext* ctx)
|
|||||||
|
|
||||||
if (ctx->simplified) {
|
if (ctx->simplified) {
|
||||||
if (!(rs & 1)) {
|
if (!(rs & 1)) {
|
||||||
ctx->instr_str = my_sprintf("%-8scr%d, r%d, r%d", "cmplw", (rs >> 2), ra, rb);
|
if ((rs >> 2) == 0)
|
||||||
|
ctx->instr_str = my_sprintf("%-8sr%d, r%d", "cmplw", ra, rb);
|
||||||
|
else
|
||||||
|
ctx->instr_str = my_sprintf("%-8scr%d, r%d, r%d", "cmplw", (rs >> 2), ra, rb);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1165,13 +1180,13 @@ void opc_group31(PPCDisasmContext* ctx)
|
|||||||
if (ctx->instr_code & 0x100801)
|
if (ctx->instr_code & 0x100801)
|
||||||
opc_illegal(ctx);
|
opc_illegal(ctx);
|
||||||
else {
|
else {
|
||||||
|
if (((ctx->instr_code >> 12) & 0xFF) == 0xFF)
|
||||||
|
ctx->instr_str = my_sprintf("%-8sr%d", "mtcr", rs);
|
||||||
|
else
|
||||||
ctx->instr_str = my_sprintf("%-8s0x%02X, r%d", "mtcrf",
|
ctx->instr_str = my_sprintf("%-8s0x%02X, r%d", "mtcrf",
|
||||||
(ctx->instr_code >> 12) & 0xFF, rs);
|
(ctx->instr_code >> 12) & 0xFF, rs);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 146: /* mtmsr */
|
|
||||||
fmt_oneop(ctx->instr_str, "mtmsr", rs);
|
|
||||||
break;
|
|
||||||
case 277: /* lscbx */
|
case 277: /* lscbx */
|
||||||
strcpy(opcode, "lscbx");
|
strcpy(opcode, "lscbx");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user