frontend: disassemble: adjust section dump output format
This commit is contained in:
@@ -164,7 +164,7 @@ static void dump_instruction(b_i32 x)
|
|||||||
case IVY_OP_BR:
|
case IVY_OP_BR:
|
||||||
case IVY_OP_BR_T:
|
case IVY_OP_BR_T:
|
||||||
case IVY_OP_BR_F:
|
case IVY_OP_BR_F:
|
||||||
printf(" $%ld", instr.i_arg[0]);
|
printf(" $%04lXh", instr.i_arg[0]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IVY_OP_OB_C_REG:
|
case IVY_OP_OB_C_REG:
|
||||||
@@ -305,7 +305,8 @@ static enum ivy_status dump_header(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" index=0x%04x\n", b_i32_btoh(text.b_index));
|
long index = b_i32_btoh(text.b_index);
|
||||||
|
printf(" index=0x%04lx [%ld]\n", index, index);
|
||||||
*dump_offset = sizeof text;
|
*dump_offset = sizeof text;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -354,7 +355,7 @@ static enum ivy_status dump_section(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" %08zx | ", i);
|
printf(" %05zx | ", i);
|
||||||
|
|
||||||
unsigned char *z = (unsigned char *)x;
|
unsigned char *z = (unsigned char *)x;
|
||||||
for (size_t ii = 0; ii < bytes_per_line; ii++) {
|
for (size_t ii = 0; ii < bytes_per_line; ii++) {
|
||||||
@@ -365,7 +366,7 @@ static enum ivy_status dump_section(
|
|||||||
printf("%02x", z[ii]);
|
printf("%02x", z[ii]);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" | ");
|
printf(" | ");
|
||||||
|
|
||||||
if (flags & DUMP_INSTRUCTIONS) {
|
if (flags & DUMP_INSTRUCTIONS) {
|
||||||
dump_instructions((b_i32 *)x, buffer_size);
|
dump_instructions((b_i32 *)x, buffer_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user