Lines Matching refs:op
41 opr_cast(struct ud* u, struct ud_operand* op)
43 switch(op->size) {
59 static void gen_operand(struct ud* u, struct ud_operand* op, int syn_cast)
61 switch(op->type) {
63 mkasm(u, "%s", ud_reg_tab[op->base - UD_R_AL]);
71 opr_cast(u, op);
78 if (op->base) {
79 mkasm(u, "%s", ud_reg_tab[op->base - UD_R_AL]);
83 if (op->index) {
86 mkasm(u, "%s", ud_reg_tab[op->index - UD_R_AL]);
90 if (op->scale)
91 mkasm(u, "*%d", op->scale);
93 if (op->offset == 8) {
94 if (op->lval.sbyte < 0)
95 mkasm(u, "-0x%x", -op->lval.sbyte);
96 else mkasm(u, "%s0x%x", (op_f) ? "+" : "", op->lval.sbyte);
98 else if (op->offset == 16)
99 mkasm(u, "%s0x%x", (op_f) ? "+" : "", op->lval.uword);
100 else if (op->offset == 32) {
102 if (op->lval.sdword < 0)
103 mkasm(u, "-0x%x", -op->lval.sdword);
104 else mkasm(u, "%s0x%x", (op_f) ? "+" : "", op->lval.sdword);
106 else mkasm(u, "%s0x%lx", (op_f) ? "+" : "", (unsigned long)op->lval.udword);
108 else if (op->offset == 64)
109 mkasm(u, "%s0x" FMT64 "x", (op_f) ? "+" : "", op->lval.uqword);
118 unsigned sext_size = op->size;
121 opr_cast(u, op);
122 switch (op->size) {
123 case 8: imm = op->lval.sbyte; break;
124 case 16: imm = op->lval.sword; break;
125 case 32: imm = op->lval.sdword; break;
126 case 64: imm = op->lval.sqword; break;
143 if (syn_cast) opr_cast(u, op);
144 switch (op->size) {
146 mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sbyte);
149 mkasm(u, "0x" FMT64 "x", ( u->pc + op->lval.sword ) & 0xffff );
152 mkasm(u, "0x" FMT64 "x", ( u->pc + op->lval.sdword ) & 0xfffffffful );
159 switch (op->size) {
161 mkasm(u, "word 0x%x:0x%x", op->lval.ptr.seg,
162 op->lval.ptr.off & 0xFFFF);
165 mkasm(u, "dword 0x%x:0x%lx", op->lval.ptr.seg,
166 (unsigned long)op->lval.ptr.off);
172 if (syn_cast) opr_cast(u, op);
173 mkasm(u, "%d", op->lval.udword);