aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-10-22 18:02:05 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-10-22 18:02:05 +0100
commite6339b10366b037893ee5385463ef4d4873b658d (patch)
tree7d995a543a9ae7d85491b205379b8fb4957d020a /src
parent47c7d6baf7d39da5e2683edc3674494fcd3874ba (diff)
downloadovm-e6339b10366b037893ee5385463ef4d4873b658d.tar.gz
ovm-e6339b10366b037893ee5385463ef4d4873b658d.tar.bz2
ovm-e6339b10366b037893ee5385463ef4d4873b658d.zip
Changed format of inst_print
Prints the opcode then any operands in the following brackets
Diffstat (limited to 'src')
-rw-r--r--src/inst.c6
1 files changed, 3 insertions, 3 deletions
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, ")");