Branch: Tag:

2017-01-17

2017-01-17 16:12:07 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [amd64]: Support jmp instructions in disassembler.

Also fixes argument order for some instructions.

4968:    sprintf(buffers[1] + strlen(buffers[1]), "$");    pos += amd64_readint32(pc + pos, buffers[1] + strlen(buffers[1]));    } +  } else if (op->flags & OP_PCREL) { +  INT32 val; +  if (!params[1]) { +  params[1] = buffers[1]; +  buffers[1][0] = 0;    } -  +  if (op->flags & (OP_8|OP_S8)) { +  val = ((signed char *)pc)[pos++]; +  } else { +  val = ((INT32 *)(pc + pos))[0]; +  pos += 4; +  } +  sprintf(buffers[1] + strlen(buffers[1]), "%p", pc + (pos + val)); +  }    -  +  if (op->flags & OP_B_RM) { +  /* Swap the two parameters. */ +  const char *tmp = params[0]; +  params[0] = params[1]; +  params[1] = tmp; +  } +     if (opcode) {    fprintf(stderr, "%s", opcode);