+ {
+ switch (operandCount)
+ {
+ case 0:
+ if (!strcmp (opcode_handle->opc0[i]->constraints, XGATE_OP_INH))
+ return opcode_handle->opc0[i];
+ break;
+ case 1:
+ if (oprs[0].reg >= REG_R0 && oprs[0].reg <= REG_R7)
+ {
+ if (!strcmp (opcode_handle->opc0[i]->constraints, XGATE_OP_MON))
+ return opcode_handle->opc0[i];
+ if (!strcmp (opcode_handle->opc0[i]->constraints, XGATE_OP_DYA_MON))
+ return opcode_handle->opc0[i];
+ }
+ if (oprs[0].reg == REG_NONE)
+ if (!strcmp (opcode_handle->opc0[i]->constraints, XGATE_OP_IMM3))
+ return opcode_handle->opc0[i];
+ break;
+ case 2:
+ if (oprs[0].reg >= REG_R0 && oprs[0].reg <= REG_R7)
+ {
+ if (oprs[1].reg >= REG_R0 && oprs[1].reg <= REG_R7)
+ {
+ if (!strcmp (opcode_handle->opc0[i]->constraints, XGATE_OP_DYA))
+ return opcode_handle->opc0[i];
+ }
+ if (oprs[1].reg == REG_CCR)
+ if (!strcmp (opcode_handle->opc0[i]->constraints,
+ XGATE_OP_MON_R_C))
+ return opcode_handle->opc0[i];
+ if (oprs[1].reg == REG_PC)
+ if (!strcmp (opcode_handle->opc0[i]->constraints,
+ XGATE_OP_MON_R_P))
+ return opcode_handle->opc0[i];
+ if (oprs[1].reg == REG_NONE)
+ if (!strcmp (opcode_handle->opc0[i]->constraints, XGATE_OP_IMM16)
+ || !strcmp (opcode_handle->opc0[i]->constraints, XGATE_OP_IMM8)
+ || !strcmp (opcode_handle->opc0[i]->constraints, XGATE_OP_IMM4)
+ || !strcmp (opcode_handle->opc0[i]->constraints,
+ XGATE_OP_IMM16mADD)
+ || !strcmp (opcode_handle->opc0[i]->constraints,
+ XGATE_OP_IMM16mAND)
+ || !strcmp (opcode_handle->opc0[i]->constraints,
+ XGATE_OP_IMM16mCPC)
+ || !strcmp (opcode_handle->opc0[i]->constraints,
+ XGATE_OP_IMM16mSUB)
+ || !strcmp (opcode_handle->opc0[i]->constraints,
+ XGATE_OP_IMM16mLDW))
+ return opcode_handle->opc0[i];
+ }
+ if (oprs[0].reg == REG_CCR)
+ if (!strcmp (opcode_handle->opc0[i]->constraints, XGATE_OP_MON_C_R))
+ return opcode_handle->opc0[i];
+ break;
+ case 3:
+ if (oprs[0].reg >= REG_R0 && oprs[0].reg <= REG_R7)
+ {
+ if (oprs[1].reg >= REG_R0 && oprs[1].reg <= REG_R7)
+ {
+ if (oprs[2].reg >= REG_R0 && oprs[2].reg <= REG_R7)
+ {
+ if (!strcmp (opcode_handle->opc0[i]->constraints,
+ XGATE_OP_IDR)
+ || !strcmp (opcode_handle->opc0[i]->constraints,
+ XGATE_OP_TRI))
+ return opcode_handle->opc0[i];
+ }
+
+ if (oprs[2].reg == REG_NONE)
+ if (!strcmp (opcode_handle->opc0[i]->constraints,
+ XGATE_OP_IDO5))
+ return opcode_handle->opc0[i];
+ }
+ }
+ break;
+ default:
+ as_bad (_("unknown operand count"));
+ break;
+ }
+ }
+ return NULL ;