annotate udis86-1.4/libudis86/syn-att.c @ 1:4a9dcbd9e54f

-files of 0.13 beta -fixes so that it now compiles with the current dmd version
author marton@basel.hu
date Tue, 05 Apr 2011 20:44:01 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
1 /* -----------------------------------------------------------------------------
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
2 * syn-att.c
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
3 *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
4 * Copyright (c) 2004, 2005, 2006 Vivek Mohan <vivek@sig9.com>
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
5 * All rights reserved. See (LICENSE)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
6 * -----------------------------------------------------------------------------
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
7 */
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
8
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
9 #include "types.h"
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
10 #include "extern.h"
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
11 #include "opcmap.h"
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
12 #include "syn.h"
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
13
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
14 /* -----------------------------------------------------------------------------
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
15 * opr_cast() - Prints an operand cast.
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
16 * -----------------------------------------------------------------------------
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
17 */
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
18 static void
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
19 opr_cast(struct ud* u, struct ud_operand* op)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
20 {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
21 switch(op->size) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
22 case 16 : case 32 :
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
23 mkasm(u, "*"); break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
24 default: break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
25 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
26 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
27
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
28 /* -----------------------------------------------------------------------------
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
29 * gen_operand() - Generates assembly output for each operand.
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
30 * -----------------------------------------------------------------------------
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
31 */
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
32 static void
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
33 gen_operand(struct ud* u, struct ud_operand* op)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
34 {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
35 switch(op->type) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
36 case UD_OP_REG:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
37 mkasm(u, "%%%s", ud_reg_tab[op->base - UD_R_AL]);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
38 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
39
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
40 case UD_OP_MEM:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
41 if (u->br_far) opr_cast(u, op);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
42 if (u->pfx_seg)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
43 mkasm(u, "%%%s:", ud_reg_tab[u->pfx_seg - UD_R_AL]);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
44 if (op->offset == 8) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
45 if (op->lval.sbyte < 0)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
46 mkasm(u, "-0x%x", (-op->lval.sbyte) & 0xff);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
47 else mkasm(u, "0x%x", op->lval.sbyte);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
48 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
49 else if (op->offset == 16)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
50 mkasm(u, "0x%x", op->lval.uword);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
51 else if (op->offset == 32)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
52 mkasm(u, "0x%lx", op->lval.udword);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
53 else if (op->offset == 64)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
54 mkasm(u, "0x" FMT64 "x", op->lval.uqword);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
55
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
56 if (op->base)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
57 mkasm(u, "(%%%s", ud_reg_tab[op->base - UD_R_AL]);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
58 if (op->index) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
59 if (op->base)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
60 mkasm(u, ",");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
61 else mkasm(u, "(");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
62 mkasm(u, "%%%s", ud_reg_tab[op->index - UD_R_AL]);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
63 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
64 if (op->scale)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
65 mkasm(u, ",%d", op->scale);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
66 if (op->base || op->index)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
67 mkasm(u, ")");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
68 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
69
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
70 case UD_OP_IMM:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
71 switch (op->size) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
72 case 8: mkasm(u, "$0x%x", op->lval.ubyte); break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
73 case 16: mkasm(u, "$0x%x", op->lval.uword); break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
74 case 32: mkasm(u, "$0x%lx", op->lval.udword); break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
75 case 64: mkasm(u, "$0x" FMT64 "x", op->lval.uqword); break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
76 default: break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
77 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
78 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
79
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
80 case UD_OP_JIMM:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
81 switch (op->size) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
82 case 8:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
83 mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sbyte);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
84 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
85 case 16:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
86 mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sword);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
87 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
88 case 32:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
89 mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sdword);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
90 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
91 default:break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
92 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
93 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
94
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
95 case UD_OP_PTR:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
96 switch (op->size) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
97 case 32:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
98 mkasm(u, "$0x%x, $0x%x", op->lval.ptr.seg,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
99 op->lval.ptr.off & 0xFFFF);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
100 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
101 case 48:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
102 mkasm(u, "$0x%x, $0x%lx", op->lval.ptr.seg,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
103 op->lval.ptr.off);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
104 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
105 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
106 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
107
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
108 default: return;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
109 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
110 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
111
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
112 /* =============================================================================
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
113 * translates to AT&T syntax
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
114 * =============================================================================
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
115 */
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
116 extern void
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
117 ud_translate_att(struct ud *u)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
118 {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
119 int size = 0;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
120
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
121 /* check if P_O32 prefix is used */
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
122 if (! P_O32(u->mapen->prefix) && u->pfx_opr) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
123 switch (u->dis_mode) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
124 case 16:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
125 mkasm(u, "o32 ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
126 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
127 case 32:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
128 case 64:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
129 mkasm(u, "o16 ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
130 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
131 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
132 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
133
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
134 /* check if P_A32 prefix was used */
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
135 if (! P_A32(u->mapen->prefix) && u->pfx_adr) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
136 switch (u->dis_mode) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
137 case 16:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
138 mkasm(u, "a32 ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
139 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
140 case 32:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
141 mkasm(u, "a16 ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
142 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
143 case 64:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
144 mkasm(u, "a32 ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
145 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
146 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
147 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
148
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
149 if (u->pfx_lock)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
150 mkasm(u, "lock ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
151 if (u->pfx_rep)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
152 mkasm(u, "rep ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
153 if (u->pfx_repne)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
154 mkasm(u, "repne ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
155
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
156 /* special instructions */
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
157 switch (u->mnemonic) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
158 case UD_Iretf:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
159 mkasm(u, "lret ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
160 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
161 case UD_Idb:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
162 mkasm(u, ".byte 0x%x", u->operand[0].lval.ubyte);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
163 return;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
164 case UD_Ijmp:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
165 case UD_Icall:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
166 if (u->br_far) mkasm(u, "l");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
167 mkasm(u, "%s", ud_lookup_mnemonic(u->mnemonic));
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
168 break;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
169 case UD_Ibound:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
170 case UD_Ienter:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
171 if (u->operand[0].type != UD_NONE)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
172 gen_operand(u, &u->operand[0]);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
173 if (u->operand[1].type != UD_NONE) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
174 mkasm(u, ",");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
175 gen_operand(u, &u->operand[1]);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
176 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
177 return;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
178 default:
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
179 mkasm(u, "%s", ud_lookup_mnemonic(u->mnemonic));
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
180 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
181
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
182 if (u->c1)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
183 size = u->operand[0].size;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
184 else if (u->c2)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
185 size = u->operand[1].size;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
186 else if (u->c3)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
187 size = u->operand[2].size;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
188
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
189 if (size == 8)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
190 mkasm(u, "b");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
191 else if (size == 16)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
192 mkasm(u, "w");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
193 else if (size == 64)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
194 mkasm(u, "q");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
195
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
196 mkasm(u, " ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
197
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
198 if (u->operand[2].type != UD_NONE) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
199 gen_operand(u, &u->operand[2]);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
200 mkasm(u, ", ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
201 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
202
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
203 if (u->operand[1].type != UD_NONE) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
204 gen_operand(u, &u->operand[1]);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
205 mkasm(u, ", ");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
206 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
207
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
208 if (u->operand[0].type != UD_NONE)
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
209 gen_operand(u, &u->operand[0]);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
210 }