Lines Matching refs:op
41 opr_cast(struct ud* u, struct ud_operand* op)
43 switch(op->size) {
55 gen_operand(struct ud* u, struct ud_operand* op)
57 switch(op->type) {
59 mkasm(u, "%%%s", ud_reg_tab[op->base - UD_R_AL]);
63 if (u->br_far) opr_cast(u, op);
66 if (op->offset == 8) {
67 if (op->lval.sbyte < 0)
68 mkasm(u, "-0x%x", (-op->lval.sbyte) & 0xff);
69 else mkasm(u, "0x%x", op->lval.sbyte);
71 else if (op->offset == 16)
72 mkasm(u, "0x%x", op->lval.uword);
73 else if (op->offset == 32)
74 mkasm(u, "0x%lx", (unsigned long)op->lval.udword);
75 else if (op->offset == 64)
76 mkasm(u, "0x" FMT64 "x", op->lval.uqword);
78 if (op->base)
79 mkasm(u, "(%%%s", ud_reg_tab[op->base - UD_R_AL]);
80 if (op->index) {
81 if (op->base)
84 mkasm(u, "%%%s", ud_reg_tab[op->index - UD_R_AL]);
86 if (op->scale)
87 mkasm(u, ",%d", op->scale);
88 if (op->base || op->index)
95 unsigned sext_size = op->size;
97 switch (op->size) {
98 case 8: imm = op->lval.sbyte; break;
99 case 16: imm = op->lval.sword; break;
100 case 32: imm = op->lval.sdword; break;
101 case 64: imm = op->lval.sqword; break;
117 switch (op->size) {
119 mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sbyte);
122 mkasm(u, "0x" FMT64 "x", (u->pc + op->lval.sword) & 0xffff );
126 mkasm(u, "0x" FMT64 "x", (u->pc + op->lval.sdword) & 0xffffffff);
128 mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sdword);
135 switch (op->size) {
137 mkasm(u, "$0x%x, $0x%x", op->lval.ptr.seg,
138 op->lval.ptr.off & 0xFFFF);
141 mkasm(u, "$0x%x, $0x%lx", op->lval.ptr.seg,
142 (unsigned long)op->lval.ptr.off);