Debian Codegraph @

src/main/java/com/kenai/jnr/x86asm/Asm.java

raw
1 //
2 // Copyright (C) 2010 Wayne Meissner
3 // Copyright (c) 2008-2009, Petr Kobalicek <[email protected]>
4 //
5 // Permission is hereby granted, free of charge, to any person
6 // obtaining a copy of this software and associated documentation
7 // files (the "Software"), to deal in the Software without
8 // restriction, including without limitation the rights to use,
9 // copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the
11 // Software is furnished to do so, subject to the following
12 // conditions:
13 //
14 // The above copyright notice and this permission notice shall be
15 // included in all copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 // OTHER DEALINGS IN THE SOFTWARE.
25
26 package com.kenai.jnr.x86asm;
27
28 import static com.kenai.jnr.x86asm.REG.*;
29 import static com.kenai.jnr.x86asm.SIZE.*;
30
31 @Deprecated
32 public final class Asm {
33 private Asm() {}
34
35 /** @deprecated Use {@link #X86_32} */
36 @Deprecated
37 public static final CPU I386 = CPU.I386;
38 public static final CPU X86_32 = CPU.X86_32;
39 public static final CPU X86_64 = CPU.X86_64;
40
41 /** No register, can be used only in @c Mem operand. */
42 public static final Register no_reg = new Register(NO_REG, 0);
43
44 /** 8 bit General purpose register. */
45 public static final Register al = Register.gpr(REG_AL);
46 /** 8 bit General purpose register. */
47 public static final Register cl = Register.gpr(REG_CL);
48 /** 8 bit General purpose register. */
49 public static final Register dl = Register.gpr(REG_DL);
50 /** 8 bit General purpose register. */
51 public static final Register bl = Register.gpr(REG_BL);
52 /** 8 bit General purpose register. */
53 public static final Register ah = Register.gpr(REG_AH);
54 /** 8 bit General purpose register. */
55 public static final Register ch = Register.gpr(REG_CH);
56 /** 8 bit General purpose register. */
57 public static final Register dh = Register.gpr(REG_DH);
58 /** 8 bit General purpose register. */
59 public static final Register bh = Register.gpr(REG_BH);
60
61 /** 8 bit General purpose register (64 bit mode only). */
62 public static final Register r8b = Register.gpr(REG_R8B);
63 /** 8 bit General purpose register (64 bit mode only). */
64 public static final Register r9b = Register.gpr(REG_R9B);
65 /** 8 bit General purpose register (64 bit mode only). */
66 public static final Register r10b = Register.gpr(REG_R10B);
67 /** 8 bit General purpose register (64 bit mode only). */
68 public static final Register r11b = Register.gpr(REG_R11B);
69 /** 8 bit General purpose register (64 bit mode only). */
70 public static final Register r12b = Register.gpr(REG_R12B);
71 /** 8 bit General purpose register (64 bit mode only). */
72 public static final Register r13b = Register.gpr(REG_R13B);
73 /** 8 bit General purpose register (64 bit mode only). */
74 public static final Register r14b = Register.gpr(REG_R14B);
75 /** 8 bit General purpose register (64 bit mode only). */
76 public static final Register r15b = Register.gpr(REG_R15B);
77
78 /** 16 bit General purpose register. */
79 public static final Register ax = Register.gpr(REG_AX);
80 /** 16 bit General purpose register. */
81 public static final Register cx = Register.gpr(REG_CX);
82 /** 16 bit General purpose register. */
83 public static final Register dx = Register.gpr(REG_DX);
84 /** 16 bit General purpose register. */
85 public static final Register bx = Register.gpr(REG_BX);
86 /** 16 bit General purpose register. */
87 public static final Register sp = Register.gpr(REG_SP);
88 /** 16 bit General purpose register. */
89 public static final Register bp = Register.gpr(REG_BP);
90 /** 16 bit General purpose register. */
91 public static final Register si = Register.gpr(REG_SI);
92 /** 16 bit General purpose register. */
93 public static final Register di = Register.gpr(REG_DI);
94
95 /** 16 bit General purpose register (64 bit mode only). */
96 public static final Register r8w = Register.gpr(REG_R8W);
97 /** 16 bit General purpose register (64 bit mode only). */
98 public static final Register r9w = Register.gpr(REG_R9W);
99 /** 16 bit General purpose register (64 bit mode only). */
100 public static final Register r10w = Register.gpr(REG_R10W);
101 /** 16 bit General purpose register (64 bit mode only). */
102 public static final Register r11w = Register.gpr(REG_R11W);
103 /** 16 bit General purpose register (64 bit mode only). */
104 public static final Register r12w = Register.gpr(REG_R12W);
105 /** 16 bit General purpose register (64 bit mode only). */
106 public static final Register r13w = Register.gpr(REG_R13W);
107 /** 16 bit General purpose register (64 bit mode only). */
108 public static final Register r14w = Register.gpr(REG_R14W);
109 /** 16 bit General purpose register (64 bit mode only). */
110 public static final Register r15w = Register.gpr(REG_R15W);
111
112 /** 32 bit General purpose register. */
113 public static final Register eax = Register.gpr(REG_EAX);
114 /** 32 bit General purpose register. */
115 public static final Register ecx = Register.gpr(REG_ECX);
116 /** 32 bit General purpose register. */
117 public static final Register edx = Register.gpr(REG_EDX);
118 /** 32 bit General purpose register. */
119 public static final Register ebx = Register.gpr(REG_EBX);
120 /** 32 bit General purpose register. */
121 public static final Register esp = Register.gpr(REG_ESP);
122 /** 32 bit General purpose register. */
123 public static final Register ebp = Register.gpr(REG_EBP);
124 /** 32 bit General purpose register. */
125 public static final Register esi = Register.gpr(REG_ESI);
126 /** 32 bit General purpose register. */
127 public static final Register edi = Register.gpr(REG_EDI);
128
129 /** 64 bit General purpose register (64 bit mode only). */
130 public static final Register rax = Register.gpr(REG_RAX);
131 /** 64 bit General purpose register (64 bit mode only). */
132 public static final Register rcx = Register.gpr(REG_RCX);
133 /** 64 bit General purpose register (64 bit mode only). */
134 public static final Register rdx = Register.gpr(REG_RDX);
135 /** 64 bit General purpose register (64 bit mode only). */
136 public static final Register rbx = Register.gpr(REG_RBX);
137 /** 64 bit General purpose register (64 bit mode only). */
138 public static final Register rsp = Register.gpr(REG_RSP);
139 /** 64 bit General purpose register (64 bit mode only). */
140 public static final Register rbp = Register.gpr(REG_RBP);
141 /** 64 bit General purpose register (64 bit mode only). */
142 public static final Register rsi = Register.gpr(REG_RSI);
143 /** 64 bit General purpose register (64 bit mode only). */
144 public static final Register rdi = Register.gpr(REG_RDI);
145
146 /** 64 bit General purpose register (64 bit mode only). */
147 public static final Register r8 = Register.gpr(REG_R8);
148 /** 64 bit General purpose register (64 bit mode only). */
149 public static final Register r9 = Register.gpr(REG_R9);
150 /** 64 bit General purpose register (64 bit mode only). */
151 public static final Register r10 = Register.gpr(REG_R10);
152 /** 64 bit General purpose register (64 bit mode only). */
153 public static final Register r11 = Register.gpr(REG_R11);
154 /** 64 bit General purpose register (64 bit mode only). */
155 public static final Register r12 = Register.gpr(REG_R12);
156 /** 64 bit General purpose register (64 bit mode only). */
157 public static final Register r13 = Register.gpr(REG_R13);
158 /** 64 bit General purpose register (64 bit mode only). */
159 public static final Register r14 = Register.gpr(REG_R14);
160 /** 64 bit General purpose register (64 bit mode only). */
161 public static final Register r15 = Register.gpr(REG_R15);
162
163 /** 64 bit MMX register. */
164 public static final MMRegister mm0 = MMRegister.mm(0);
165 /** 64 bit MMX register. */
166 public static final MMRegister mm1 = MMRegister.mm(1);
167 /** 64 bit MMX register. */
168 public static final MMRegister mm2 = MMRegister.mm(2);
169 /** 64 bit MMX register. */
170 public static final MMRegister mm3 = MMRegister.mm(3);
171 /** 64 bit MMX register. */
172 public static final MMRegister mm4 = MMRegister.mm(4);
173 /** 64 bit MMX register. */
174 public static final MMRegister mm5 = MMRegister.mm(5);
175 /** 64 bit MMX register. */
176 public static final MMRegister mm6 = MMRegister.mm(6);
177 /** 64 bit MMX register. */
178 public static final MMRegister mm7 = MMRegister.mm(7);
179
180 /** 128 bit SSE register. */
181 public static final XMMRegister xmm0 = XMMRegister.xmm(0);
182 /** 128 bit SSE register. */
183 public static final XMMRegister xmm1 = XMMRegister.xmm(1);
184 /** 128 bit SSE register. */
185 public static final XMMRegister xmm2 = XMMRegister.xmm(2);
186 /** 128 bit SSE register. */
187 public static final XMMRegister xmm3 = XMMRegister.xmm(3);
188 /** 128 bit SSE register. */
189 public static final XMMRegister xmm4 = XMMRegister.xmm(4);
190 /** 128 bit SSE register. */
191 public static final XMMRegister xmm5 = XMMRegister.xmm(5);
192 /** 128 bit SSE register. */
193 public static final XMMRegister xmm6 = XMMRegister.xmm(6);
194 /** 128 bit SSE register. */
195 public static final XMMRegister xmm7 = XMMRegister.xmm(7);
196
197
198 /** 128 bit SSE register (64 bit mode only). */
199 public static final XMMRegister xmm8 = XMMRegister.xmm(8);
200 /** 128 bit SSE register (64 bit mode only). */
201 public static final XMMRegister xmm9 = XMMRegister.xmm(9);
202 /** 128 bit SSE register (64 bit mode only). */
203 public static final XMMRegister xmm10 = XMMRegister.xmm(10);
204 /** 128 bit SSE register (64 bit mode only). */
205 public static final XMMRegister xmm11 = XMMRegister.xmm(11);
206 /** 128 bit SSE register (64 bit mode only). */
207 public static final XMMRegister xmm12 = XMMRegister.xmm(12);
208 /** 128 bit SSE register (64 bit mode only). */
209 public static final XMMRegister xmm13 = XMMRegister.xmm(13);
210 /** 128 bit SSE register (64 bit mode only). */
211 public static final XMMRegister xmm14 = XMMRegister.xmm(14);
212 /** 128 bit SSE register (64 bit mode only). */
213 public static final XMMRegister xmm15 = XMMRegister.xmm(15);
214
215 static final Mem _ptr_build(Label label, long disp, int ptrSize) {
216 return new Mem(label, disp, ptrSize);
217 }
218
219 static final Mem _ptr_build(Label label, Register index, int shift, long disp, int ptrSize) {
220 return new Mem(label, index, shift, disp, ptrSize);
221 }
222
223 /** Absolute addressing */
224 static final Mem _ptr_build_abs(long target, long disp, SEGMENT segmentPrefix, int ptrSize) {
225 return new Mem(target, disp, segmentPrefix, ptrSize);
226 }
227
228 static final Mem _ptr_build_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix, int ptrSize) {
229 return new Mem(target, index, shift, segmentPrefix, disp, ptrSize);
230 }
231
232 static final Mem _ptr_build(Register base, long disp, int ptrSize) {
233 return new Mem(base, disp, ptrSize);
234 }
235
236 static final Mem _ptr_build(Register base, Register index, int shift, long disp, int ptrSize) {
237 return new Mem(base, index, shift, disp, ptrSize);
238 }
239
240
241 // ============================================================================
242 // [AsmJit::Mem - ptr[displacement]]
243 // ============================================================================
244
245 /** Create pointer operand with not specified size. */
246 public static final Mem ptr(Label label, long disp) {
247 return _ptr_build(label, disp, 0);
248 }
249
250 /** Create pointer operand with not specified size. */
251 public static final Mem ptr(Label label) {
252 return _ptr_build(label, 0, 0);
253 }
254
255 /**Create byte pointer operand. */
256 public static final Mem byte_ptr(Label label, long disp) {
257 return _ptr_build(label, disp, SIZE_BYTE);
258 }
259
260 /**Create byte pointer operand. */
261 public static final Mem byte_ptr(Label label) {
262 return _ptr_build(label, 0, SIZE_BYTE);
263 }
264
265 /** Create word (2 Bytes) pointer operand. */
266 public static final Mem word_ptr(Label label, long disp) {
267 return _ptr_build(label, disp, SIZE_WORD);
268 }
269
270 /** Create word (2 Bytes) pointer operand. */
271 public static final Mem word_ptr(Label label) {
272 return _ptr_build(label, 0, SIZE_WORD);
273 }
274
275 /** Create dword (4 Bytes) pointer operand. */
276 public static final Mem dword_ptr(Label label, long disp) {
277 return _ptr_build(label, disp, SIZE_DWORD);
278 }
279
280 /** Create dword (4 Bytes) pointer operand. */
281 public static final Mem dword_ptr(Label label) {
282 return _ptr_build(label, 0, SIZE_DWORD);
283 }
284
285 /** Create qword (8 Bytes) pointer operand. */
286 public static final Mem qword_ptr(Label label, long disp) {
287 return _ptr_build(label, disp, SIZE_QWORD);
288 }
289
290 /** Create qword (8 Bytes) pointer operand. */
291 public static final Mem qword_ptr(Label label) {
292 return _ptr_build(label, 0, SIZE_QWORD);
293 }
294
295 /** Create tword (10 Bytes) pointer operand (used for 80 bit floating points). */
296 public static final Mem tword_ptr(Label label, long disp) {
297 return _ptr_build(label, disp, SIZE_TWORD);
298 }
299
300 /** Create tword (10 Bytes) pointer operand (used for 80 bit floating points). */
301 public static final Mem tword_ptr(Label label) {
302 return _ptr_build(label, 0, SIZE_TWORD);
303 }
304
305 /** Create dqword (16 Bytes) pointer operand. */
306 public static final Mem dqword_ptr(Label label, long disp) {
307 return _ptr_build(label, disp, SIZE_DQWORD);
308 }
309
310 /** Create dqword (16 Bytes) pointer operand. */
311 public static final Mem dqword_ptr(Label label) {
312 return _ptr_build(label, 0, SIZE_DQWORD);
313 }
314
315 /**
316 * Create mmword (8 bytes) pointer operand
317 *
318 * <b>Note:</b>This constructor is provided only for convenience for mmx programming.
319 */
320 public static final Mem mmword_ptr(Label label, long disp) {
321 return _ptr_build(label, disp, SIZE_QWORD);
322 }
323
324 /**
325 * Create mmword (8 bytes) pointer operand
326 *
327 * <b>Note:</b>This constructor is provided only for convenience for mmx programming.
328 */
329 public static final Mem mmword_ptr(Label label) {
330 return _ptr_build(label, 0, SIZE_QWORD);
331 }
332
333 /** Create xmmword (16 bytes) pointer operand
334 //!
335 //! @note This constructor is provided only for convenience for sse programming. */
336 public static final Mem xmmword_ptr(Label label, long disp) {
337 return _ptr_build(label, disp, SIZE_DQWORD);
338 }
339
340 /** Create xmmword (16 bytes) pointer operand
341 //!
342 //! @note This constructor is provided only for convenience for sse programming. */
343 public static final Mem xmmword_ptr(Label label) {
344 return _ptr_build(label, 0, SIZE_DQWORD);
345 }
346
347 /** Create pointer operand with not specified size. */
348 public static final Mem ptr(Label label, Register index, int shift, long disp) {
349 return _ptr_build(label, index, shift, disp, 0);
350 }
351
352 /** Create byte pointer operand. */
353 public static final Mem byte_ptr(Label label, Register index, int shift, long disp) {
354 return _ptr_build(label, index, shift, disp, SIZE_BYTE);
355 }
356
357 /** Create word (2 Bytes) pointer operand. */
358 public static final Mem word_ptr(Label label, Register index, int shift, long disp) {
359 return _ptr_build(label, index, shift, disp, SIZE_WORD);
360 }
361
362 /** Create dword (4 Bytes) pointer operand. */
363 public static final Mem dword_ptr(Label label, Register index, int shift, long disp) {
364 return _ptr_build(label, index, shift, disp, SIZE_DWORD);
365 }
366
367 /** Create qword (8 Bytes) pointer operand. */
368 public static final Mem qword_ptr(Label label, Register index, int shift, long disp) {
369 return _ptr_build(label, index, shift, disp, SIZE_QWORD);
370 }
371
372 /** Create tword (10 Bytes) pointer operand (used for 80 bit floating points). */
373 public static final Mem tword_ptr(Label label, Register index, int shift, long disp) {
374 return _ptr_build(label, index, shift, disp, SIZE_TWORD);
375 }
376
377 /** Create dqword (16 Bytes) pointer operand. */
378 public static final Mem dqword_ptr(Label label, Register index, int shift, long disp) {
379 return _ptr_build(label, index, shift, disp, SIZE_DQWORD);
380 }
381
382 /** Create mmword (8 bytes) pointer operand
383 //!
384 //! @note This constructor is provided only for convenience for mmx programming. */
385 public static final Mem mmword_ptr(Label label, Register index, int shift, long disp) {
386 return _ptr_build(label, index, shift, disp, SIZE_QWORD);
387 }
388
389 /** Create xmmword (16 bytes) pointer operand
390 //!
391 //! @note This constructor is provided only for convenience for sse programming. */
392 public static final Mem xmmword_ptr(Label label, Register index, int shift, long disp) {
393 return _ptr_build(label, index, shift, disp, SIZE_DQWORD);
394 }
395
396 /** Create pointer operand with not specified size. */
397 public static final Mem ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
398 return _ptr_build_abs(target, disp, segmentPrefix, 0);
399 }
400
401 /** Create byte pointer operand. */
402 public static final Mem byte_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
403 return _ptr_build_abs(target, disp, segmentPrefix, SIZE_BYTE);
404 }
405
406 /** Create word (2 Bytes) pointer operand. */
407 public static final Mem word_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
408 return _ptr_build_abs(target, disp, segmentPrefix, SIZE_WORD);
409 }
410
411 /** Create dword (4 Bytes) pointer operand. */
412 public static final Mem dword_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
413 return _ptr_build_abs(target, disp, segmentPrefix, SIZE_DWORD);
414 }
415
416 /** Create qword (8 Bytes) pointer operand. */
417 public static final Mem qword_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
418 return _ptr_build_abs(target, disp, segmentPrefix, SIZE_QWORD);
419 }
420
421 /** Create tword (10 Bytes) pointer operand (used for 80 bit floating points). */
422 public static final Mem tword_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
423 return _ptr_build_abs(target, disp, segmentPrefix, SIZE_TWORD);
424 }
425
426 /** Create dqword (16 Bytes) pointer operand. */
427 public static final Mem dqword_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
428 return _ptr_build_abs(target, disp, segmentPrefix, SIZE_DQWORD);
429 }
430
431 /** Create mmword (8 bytes) pointer operand
432 //!
433 //! @note This constructor is provided only for convenience for mmx programming. */
434 public static final Mem mmword_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
435 return _ptr_build_abs(target, disp, segmentPrefix, SIZE_QWORD);
436 }
437
438 /** Create xmmword (16 bytes) pointer operand
439 //!
440 //! @note This constructor is provided only for convenience for sse programming. */
441 public static final Mem xmmword_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
442 return _ptr_build_abs(target, disp, segmentPrefix, SIZE_DQWORD);
443 }
444
445 /** Create pointer operand with not specified size. */
446 public static final Mem ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
447 return _ptr_build_abs(target, index, shift, disp, segmentPrefix, 0);
448 }
449
450 /** Create byte pointer operand. */
451 public static final Mem byte_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
452 return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_BYTE);
453 }
454
455 /** Create word (2 Bytes) pointer operand. */
456 public static final Mem word_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
457 return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_WORD);
458 }
459
460 /** Create dword (4 Bytes) pointer operand. */
461 public static final Mem dword_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
462 return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_DWORD);
463 }
464
465 /** Create qword (8 Bytes) pointer operand. */
466 public static final Mem qword_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
467 return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_QWORD);
468 }
469
470 /** Create tword (10 Bytes) pointer operand (used for 80 bit floating points). */
471 public static final Mem tword_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
472 return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_TWORD);
473 }
474
475 /** Create dqword (16 Bytes) pointer operand. */
476 public static final Mem dqword_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
477 return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_DQWORD);
478 }
479
480 /** Create mmword (8 bytes) pointer operand
481 //!
482 //! @note This constructor is provided only for convenience for mmx programming. */
483 public static final Mem mmword_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
484 return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_QWORD);
485 }
486
487 /** Create xmmword (16 bytes) pointer operand
488 //!
489 //! @note This constructor is provided only for convenience for sse programming. */
490 public static final Mem xmmword_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
491 return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_DQWORD);
492 }
493
494 // ============================================================================
495 // [AsmJit::Mem - ptr[base + displacement]]
496 // ============================================================================
497 /** Create pointer operand with not specified size. */
498 public static final Mem ptr(Register base, long disp) {
499 return _ptr_build(base, disp, 0);
500 }
501
502 /** Create byte pointer operand. */
503 public static final Mem byte_ptr(Register base, long disp) {
504 return _ptr_build(base, disp, SIZE_BYTE);
505 }
506
507 /** Create word (2 Bytes) pointer operand. */
508 public static final Mem word_ptr(Register base, long disp) {
509 return _ptr_build(base, disp, SIZE_WORD);
510 }
511
512 /** Create dword (4 Bytes) pointer operand. */
513 public static final Mem dword_ptr(Register base, long disp) {
514 return _ptr_build(base, disp, SIZE_DWORD);
515 }
516
517 /** Create qword (8 Bytes) pointer operand. */
518 public static final Mem qword_ptr(Register base, long disp) {
519 return _ptr_build(base, disp, SIZE_QWORD);
520 }
521
522 /** Create tword (10 Bytes) pointer operand (used for 80 bit floating points). */
523 public static final Mem tword_ptr(Register base, long disp) {
524 return _ptr_build(base, disp, SIZE_TWORD);
525 }
526
527 /** Create dqword (16 Bytes) pointer operand. */
528 public static final Mem dqword_ptr(Register base, long disp) {
529 return _ptr_build(base, disp, SIZE_DQWORD);
530 }
531
532 /** Create mmword (8 bytes) pointer operand
533 //!
534 //! @note This constructor is provided only for convenience for mmx programming. */
535 public static final Mem mmword_ptr(Register base, long disp) {
536 return _ptr_build(base, disp, SIZE_QWORD);
537 }
538
539 /** Create xmmword (16 bytes) pointer operand
540 //!
541 //! @note This constructor is provided only for convenience for sse programming. */
542 public static final Mem xmmword_ptr(Register base, long disp) {
543 return _ptr_build(base, disp, SIZE_DQWORD);
544 }
545
546 // ============================================================================
547 // [AsmJit::Mem - ptr[base + (index << shift) + displacement]]
548 // ============================================================================
549
550 /** Create pointer operand with not specified size. */
551 public static final Mem ptr(Register base, Register index, int shift, long disp) {
552 return _ptr_build(base, index, shift, disp, 0);
553 }
554
555 /** Create byte pointer operand. */
556 public static final Mem byte_ptr(Register base, Register index, int shift, long disp) {
557 return _ptr_build(base, index, shift, disp, SIZE_BYTE);
558 }
559
560 /** Create word (2 Bytes) pointer operand. */
561 public static final Mem word_ptr(Register base, Register index, int shift, long disp) {
562 return _ptr_build(base, index, shift, disp, SIZE_WORD);
563 }
564
565 /** Create dword (4 Bytes) pointer operand. */
566 public static final Mem dword_ptr(Register base, Register index, int shift, long disp) {
567 return _ptr_build(base, index, shift, disp, SIZE_DWORD);
568 }
569
570 /** Create qword (8 Bytes) pointer operand. */
571 public static final Mem qword_ptr(Register base, Register index, int shift, long disp) {
572 return _ptr_build(base, index, shift, disp, SIZE_QWORD);
573 }
574
575 /** Create tword (10 Bytes) pointer operand (used for 80 bit floating points). */
576 public static final Mem tword_ptr(Register base, Register index, int shift, long disp) {
577 return _ptr_build(base, index, shift, disp, SIZE_TWORD);
578 }
579
580 /** Create dqword (16 Bytes) pointer operand. */
581 public static final Mem dqword_ptr(Register base, Register index, int shift, long disp) {
582 return _ptr_build(base, index, shift, disp, SIZE_DQWORD);
583 }
584
585 /** Create mmword (8 Bytes) pointer operand).
586 //!
587 //! @note This constructor is provided only for convenience for mmx programming. */
588 public static final Mem mmword_ptr(Register base, Register index, int shift, long disp) {
589 return _ptr_build(base, index, shift, disp, SIZE_QWORD);
590 }
591
592 /** Create xmmword (16 Bytes) pointer operand.
593 //!
594 //! @note This constructor is provided only for convenience for sse programming. */
595 public static final Mem xmmword_ptr(Register base, Register index, int shift, long disp) {
596 return _ptr_build(base, index, shift, disp, SIZE_DQWORD);
597 }
598
599 public static final Immediate imm(long value) {
600 return Immediate.imm(value);
601 }
602
603 public static final Immediate uimm(long value) {
604 return Immediate.imm(value);
605 }
606 }