From e6339b10366b037893ee5385463ef4d4873b658d Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 22 Oct 2023 18:02:05 +0100 Subject: Changed format of inst_print Prints the opcode then any operands in the following brackets --- src/inst.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/inst.c') diff --git a/src/inst.c b/src/inst.c index 865a933..74dd736 100644 --- a/src/inst.c +++ b/src/inst.c @@ -145,17 +145,17 @@ data_type_t get_opcode_data_type(opcode_t opcode) void inst_print(inst_t instruction, FILE *fp) { - fprintf(fp, "(%s", opcode_as_cstr(instruction.opcode)); + fprintf(fp, "%s(", opcode_as_cstr(instruction.opcode)); if (OPCODE_IS_TYPE(instruction.opcode, OP_PUSH)) { data_type_t type = get_opcode_data_type(instruction.opcode); - fprintf(fp, ", datum=0x"); + fprintf(fp, "datum=0x"); data_print(instruction.operand, type, fp); } else if (OPCODE_IS_TYPE(instruction.opcode, OP_PUSH_REGISTER) || OPCODE_IS_TYPE(instruction.opcode, OP_MOV)) { - fprintf(fp, ", reg=0x"); + fprintf(fp, "reg=0x"); data_print(instruction.operand, DATA_TYPE_BYTE, fp); } fprintf(fp, ")"); -- cgit v1.2.3-13-gbd6f