better printing

master
vhaudiquet 1 year ago
parent cdf2ed883a
commit ce1729d5b1
  1. 6
      src/cpu/rv32cpu.c

@ -814,15 +814,15 @@ static void cpu_print_instruction(instruction_t* instruction)
{
case FUNC3_SB:
// Store Byte (8-bits)
printf("sb x%u, %d(x%u)\n", instruction->rs1, immediate, instruction->rs2);
printf("sb x%u, %d(x%u)\n", instruction->rs2, immediate, instruction->rs1);
break;
case FUNC3_SH:
// Store Halfword (16-bits)
printf("sh x%u, %d(x%u)\n", instruction->rs1, immediate, instruction->rs2);
printf("sh x%u, %d(x%u)\n", instruction->rs2, immediate, instruction->rs1);
break;
case FUNC3_SW:
// Store Word (32-bits)
printf("sw x%u, %d(x%u)\n", instruction->rs1, immediate, instruction->rs2);
printf("sw x%u, %d(x%u)\n", instruction->rs2, immediate, instruction->rs1);
break;
default:
fprintf(stderr, "Warning: Unknown func3 0x%x for store instruction\n", instruction->func3);

Loading…
Cancel
Save