+ if (arch & cpuxgate)
+ {
+ /* Get two bytes as all XGATE instructions are 16bit. */
+ status = read_memory (memaddr, buffer, 2, info);
+ if (status != 0)
+ return status;
+
+ format = 0;
+ code = (buffer[0] << 8) + buffer[1];
+
+ /* Scan the opcode table until we find the opcode
+ with the corresponding page. */
+ opcode = m68hc11_opcodes;
+ for (i = 0; i < m68hc11_num_opcodes; i++, opcode++)
+ {
+ if ((opcode->opcode != (code & opcode->xg_mask)) || (opcode->arch != cpuxgate))
+ continue;
+ /* We have found the opcode. Extract the operand and print it. */
+ (*info->fprintf_func) (info->stream, "%s", opcode->name);
+ format = opcode->format;
+ if (format & (M68XG_OP_NONE))
+ {
+ /* Nothing to print. */
+ }
+ else if (format & M68XG_OP_IMM3)
+ (*info->fprintf_func) (info->stream, " #0x%x", (code >> 8) & 0x7);
+ else if (format & M68XG_OP_R_R)
+ (*info->fprintf_func) (info->stream, " R%x, R%x",
+ (code >> 8) & 0x7, (code >> 5) & 0x7);
+ else if (format & M68XG_OP_R_R_R)
+ (*info->fprintf_func) (info->stream, " R%x, R%x, R%x",
+ (code >> 8) & 0x7, (code >> 5) & 0x7, (code >> 2) & 0x7);
+ else if (format & M68XG_OP_RD_RB_RI)
+ (*info->fprintf_func) (info->stream, " R%x, (R%x, R%x)",
+ (code >> 8) & 0x7, (code >> 5) & 0x7, (code >> 2) & 0x7);
+ else if (format & M68XG_OP_RD_RB_RIp)
+ (*info->fprintf_func) (info->stream, " R%x, (R%x, R%x+)",
+ (code >> 8) & 0x7, (code >> 5) & 0x7, (code >> 2) & 0x7);
+ else if (format & M68XG_OP_RD_RB_mRI)
+ (*info->fprintf_func) (info->stream, " R%x, (R%x, -R%x)",
+ (code >> 8) & 0x7, (code >> 5) & 0x7, (code >> 2) & 0x7);
+ else if (format & M68XG_OP_R_R_OFFS5)
+ (*info->fprintf_func) (info->stream, " R%x, (R%x, #0x%x)",
+ (code >> 8) & 0x7, (code >> 5) & 0x7, code & 0x1f);
+ else if (format & M68XG_OP_R_IMM8)
+ (*info->fprintf_func) (info->stream, " R%x, #0x%02x",
+ (code >> 8) & 0x7, code & 0xff);
+ else if (format & M68XG_OP_R_IMM4)
+ (*info->fprintf_func) (info->stream, " R%x, #0x%x",
+ (code >> 8) & 0x7, (code & 0xf0) >> 4);
+ else if (format & M68XG_OP_REL9)
+ {
+ (*info->fprintf_func) (info->stream, " 0x");
+ val = buffer[1] - ((buffer[0] & 1) << 8);
+ (*info->print_address_func) (memaddr + (val << 1) + 2, info);
+ }
+ else if (format & M68XG_OP_REL10)
+ {
+ (*info->fprintf_func) (info->stream, " 0x");
+ val = (buffer[0] << 8) | buffer[1];
+ val = ((val & 0x3ff) ^ 0x200) - 0x200;
+ (*info->print_address_func) (memaddr + (val << 1) + 2, info);
+ }
+ else if ((code & 0x00ff) == 0x00f8)
+ (*info->fprintf_func) (info->stream, " R%x, CCR", (code >> 8) & 0x7);
+ else if ((code & 0x00ff) == 0x00f9)
+ (*info->fprintf_func) (info->stream, " CCR, R%x", (code >> 8) & 0x7);
+ else if ((code & 0x00ff) == 0x0)
+ (*info->fprintf_func) (info->stream, " R%x, PC", (code >> 8) & 0x7);
+ else if (format & M68XG_OP_R)
+ {
+ /* Special cases for TFR. */
+ if ((code & 0xf8ff) == 0x00f8)
+ (*info->fprintf_func) (info->stream, " R%x, CCR", (code >> 8) & 0x7);
+ else if ((code & 0xf8ff) == 0x00f9)
+ (*info->fprintf_func) (info->stream, " CCR, R%x", (code >> 8) & 0x7);
+ else if ((code & 0xf8ff) == 0x00fa)
+ (*info->fprintf_func) (info->stream, " R%x, PC", (code >> 8) & 0x7);
+ else
+ (*info->fprintf_func) (info->stream, " R%x", (code >> 8) & 0x7);
+ }
+ else
+ /* Opcode not recognized. */
+ (*info->fprintf_func) (info->stream, "Not yet handled TEST .byte\t0x%04x", code);
+ return 2;
+ }
+
+ /* Opcode not recognized. */
+ (*info->fprintf_func) (info->stream, ".byte\t0x%04x", code);
+ return 2; /* Everything is two bytes. */
+ }
+
+ /* HC11 and HC12. */
+