blob: e023cf88daafbc983580b3a9da1baeec11687cbc [file] [log] [blame]
Stefan Reinauer38cd29e2009-08-11 21:28:25 +00001/****************************************************************************
2*
3* Realmode X86 Emulator Library
4*
5* Copyright (C) 1996-1999 SciTech Software, Inc.
6* Copyright (C) David Mosberger-Tang
7* Copyright (C) 1999 Egbert Eich
8*
9* ========================================================================
10*
11* Permission to use, copy, modify, distribute, and sell this software and
12* its documentation for any purpose is hereby granted without fee,
13* provided that the above copyright notice appear in all copies and that
14* both that copyright notice and this permission notice appear in
15* supporting documentation, and that the name of the authors not be used
16* in advertising or publicity pertaining to distribution of the software
17* without specific, written prior permission. The authors makes no
18* representations about the suitability of this software for any purpose.
19* It is provided "as is" without express or implied warranty.
20*
21* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
22* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
23* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
24* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
25* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27* PERFORMANCE OF THIS SOFTWARE.
28*
29* ========================================================================
30*
31* Language: Watcom C++ 10.6 or later
32* Environment: Any
33* Developer: Kendall Bennett
34*
35* Description: Inline assembler versions of the primitive operand
36* functions for faster performance. At the moment this is
37* x86 inline assembler, but these functions could be replaced
38* with native inline assembler for each supported processor
39* platform.
40*
41****************************************************************************/
Stefan Reinauer38cd29e2009-08-11 21:28:25 +000042
43#ifndef __X86EMU_PRIM_ASM_H
44#define __X86EMU_PRIM_ASM_H
45
46#ifdef __WATCOMC__
47
48#ifndef VALIDATE
49#define __HAVE_INLINE_ASSEMBLER__
50#endif
51
52u32 get_flags_asm(void);
53#pragma aux get_flags_asm = \
54 "pushf" \
55 "pop eax" \
56 value [eax] \
57 modify exact [eax];
58
59u16 aaa_word_asm(u32 *flags,u16 d);
60#pragma aux aaa_word_asm = \
61 "push [edi]" \
62 "popf" \
63 "aaa" \
64 "pushf" \
65 "pop [edi]" \
66 parm [edi] [ax] \
67 value [ax] \
68 modify exact [ax];
69
70u16 aas_word_asm(u32 *flags,u16 d);
71#pragma aux aas_word_asm = \
72 "push [edi]" \
73 "popf" \
74 "aas" \
75 "pushf" \
76 "pop [edi]" \
77 parm [edi] [ax] \
78 value [ax] \
79 modify exact [ax];
80
81u16 aad_word_asm(u32 *flags,u16 d);
82#pragma aux aad_word_asm = \
83 "push [edi]" \
84 "popf" \
85 "aad" \
86 "pushf" \
87 "pop [edi]" \
88 parm [edi] [ax] \
89 value [ax] \
90 modify exact [ax];
91
92u16 aam_word_asm(u32 *flags,u8 d);
93#pragma aux aam_word_asm = \
94 "push [edi]" \
95 "popf" \
96 "aam" \
97 "pushf" \
98 "pop [edi]" \
99 parm [edi] [al] \
100 value [ax] \
101 modify exact [ax];
102
103u8 adc_byte_asm(u32 *flags,u8 d, u8 s);
104#pragma aux adc_byte_asm = \
105 "push [edi]" \
106 "popf" \
107 "adc al,bl" \
108 "pushf" \
109 "pop [edi]" \
110 parm [edi] [al] [bl] \
111 value [al] \
112 modify exact [al bl];
113
114u16 adc_word_asm(u32 *flags,u16 d, u16 s);
115#pragma aux adc_word_asm = \
116 "push [edi]" \
117 "popf" \
118 "adc ax,bx" \
119 "pushf" \
120 "pop [edi]" \
121 parm [edi] [ax] [bx] \
122 value [ax] \
123 modify exact [ax bx];
124
125u32 adc_long_asm(u32 *flags,u32 d, u32 s);
126#pragma aux adc_long_asm = \
127 "push [edi]" \
128 "popf" \
129 "adc eax,ebx" \
130 "pushf" \
131 "pop [edi]" \
132 parm [edi] [eax] [ebx] \
133 value [eax] \
134 modify exact [eax ebx];
135
136u8 add_byte_asm(u32 *flags,u8 d, u8 s);
137#pragma aux add_byte_asm = \
138 "push [edi]" \
139 "popf" \
140 "add al,bl" \
141 "pushf" \
142 "pop [edi]" \
143 parm [edi] [al] [bl] \
144 value [al] \
145 modify exact [al bl];
146
147u16 add_word_asm(u32 *flags,u16 d, u16 s);
148#pragma aux add_word_asm = \
149 "push [edi]" \
150 "popf" \
151 "add ax,bx" \
152 "pushf" \
153 "pop [edi]" \
154 parm [edi] [ax] [bx] \
155 value [ax] \
156 modify exact [ax bx];
157
158u32 add_long_asm(u32 *flags,u32 d, u32 s);
159#pragma aux add_long_asm = \
160 "push [edi]" \
161 "popf" \
162 "add eax,ebx" \
163 "pushf" \
164 "pop [edi]" \
165 parm [edi] [eax] [ebx] \
166 value [eax] \
167 modify exact [eax ebx];
168
169u8 and_byte_asm(u32 *flags,u8 d, u8 s);
170#pragma aux and_byte_asm = \
171 "push [edi]" \
172 "popf" \
173 "and al,bl" \
174 "pushf" \
175 "pop [edi]" \
176 parm [edi] [al] [bl] \
177 value [al] \
178 modify exact [al bl];
179
180u16 and_word_asm(u32 *flags,u16 d, u16 s);
181#pragma aux and_word_asm = \
182 "push [edi]" \
183 "popf" \
184 "and ax,bx" \
185 "pushf" \
186 "pop [edi]" \
187 parm [edi] [ax] [bx] \
188 value [ax] \
189 modify exact [ax bx];
190
191u32 and_long_asm(u32 *flags,u32 d, u32 s);
192#pragma aux and_long_asm = \
193 "push [edi]" \
194 "popf" \
195 "and eax,ebx" \
196 "pushf" \
197 "pop [edi]" \
198 parm [edi] [eax] [ebx] \
199 value [eax] \
200 modify exact [eax ebx];
201
202u8 cmp_byte_asm(u32 *flags,u8 d, u8 s);
203#pragma aux cmp_byte_asm = \
204 "push [edi]" \
205 "popf" \
206 "cmp al,bl" \
207 "pushf" \
208 "pop [edi]" \
209 parm [edi] [al] [bl] \
210 value [al] \
211 modify exact [al bl];
212
213u16 cmp_word_asm(u32 *flags,u16 d, u16 s);
214#pragma aux cmp_word_asm = \
215 "push [edi]" \
216 "popf" \
217 "cmp ax,bx" \
218 "pushf" \
219 "pop [edi]" \
220 parm [edi] [ax] [bx] \
221 value [ax] \
222 modify exact [ax bx];
223
224u32 cmp_long_asm(u32 *flags,u32 d, u32 s);
225#pragma aux cmp_long_asm = \
226 "push [edi]" \
227 "popf" \
228 "cmp eax,ebx" \
229 "pushf" \
230 "pop [edi]" \
231 parm [edi] [eax] [ebx] \
232 value [eax] \
233 modify exact [eax ebx];
234
235u8 daa_byte_asm(u32 *flags,u8 d);
236#pragma aux daa_byte_asm = \
237 "push [edi]" \
238 "popf" \
239 "daa" \
240 "pushf" \
241 "pop [edi]" \
242 parm [edi] [al] \
243 value [al] \
244 modify exact [al];
245
246u8 das_byte_asm(u32 *flags,u8 d);
247#pragma aux das_byte_asm = \
248 "push [edi]" \
249 "popf" \
250 "das" \
251 "pushf" \
252 "pop [edi]" \
253 parm [edi] [al] \
254 value [al] \
255 modify exact [al];
256
257u8 dec_byte_asm(u32 *flags,u8 d);
258#pragma aux dec_byte_asm = \
259 "push [edi]" \
260 "popf" \
261 "dec al" \
262 "pushf" \
263 "pop [edi]" \
264 parm [edi] [al] \
265 value [al] \
266 modify exact [al];
267
268u16 dec_word_asm(u32 *flags,u16 d);
269#pragma aux dec_word_asm = \
270 "push [edi]" \
271 "popf" \
272 "dec ax" \
273 "pushf" \
274 "pop [edi]" \
275 parm [edi] [ax] \
276 value [ax] \
277 modify exact [ax];
278
279u32 dec_long_asm(u32 *flags,u32 d);
280#pragma aux dec_long_asm = \
281 "push [edi]" \
282 "popf" \
283 "dec eax" \
284 "pushf" \
285 "pop [edi]" \
286 parm [edi] [eax] \
287 value [eax] \
288 modify exact [eax];
289
290u8 inc_byte_asm(u32 *flags,u8 d);
291#pragma aux inc_byte_asm = \
292 "push [edi]" \
293 "popf" \
294 "inc al" \
295 "pushf" \
296 "pop [edi]" \
297 parm [edi] [al] \
298 value [al] \
299 modify exact [al];
300
301u16 inc_word_asm(u32 *flags,u16 d);
302#pragma aux inc_word_asm = \
303 "push [edi]" \
304 "popf" \
305 "inc ax" \
306 "pushf" \
307 "pop [edi]" \
308 parm [edi] [ax] \
309 value [ax] \
310 modify exact [ax];
311
312u32 inc_long_asm(u32 *flags,u32 d);
313#pragma aux inc_long_asm = \
314 "push [edi]" \
315 "popf" \
316 "inc eax" \
317 "pushf" \
318 "pop [edi]" \
319 parm [edi] [eax] \
320 value [eax] \
321 modify exact [eax];
322
323u8 or_byte_asm(u32 *flags,u8 d, u8 s);
324#pragma aux or_byte_asm = \
325 "push [edi]" \
326 "popf" \
327 "or al,bl" \
328 "pushf" \
329 "pop [edi]" \
330 parm [edi] [al] [bl] \
331 value [al] \
332 modify exact [al bl];
333
334u16 or_word_asm(u32 *flags,u16 d, u16 s);
335#pragma aux or_word_asm = \
336 "push [edi]" \
337 "popf" \
338 "or ax,bx" \
339 "pushf" \
340 "pop [edi]" \
341 parm [edi] [ax] [bx] \
342 value [ax] \
343 modify exact [ax bx];
344
345u32 or_long_asm(u32 *flags,u32 d, u32 s);
346#pragma aux or_long_asm = \
347 "push [edi]" \
348 "popf" \
349 "or eax,ebx" \
350 "pushf" \
351 "pop [edi]" \
352 parm [edi] [eax] [ebx] \
353 value [eax] \
354 modify exact [eax ebx];
355
356u8 neg_byte_asm(u32 *flags,u8 d);
357#pragma aux neg_byte_asm = \
358 "push [edi]" \
359 "popf" \
360 "neg al" \
361 "pushf" \
362 "pop [edi]" \
363 parm [edi] [al] \
364 value [al] \
365 modify exact [al];
366
367u16 neg_word_asm(u32 *flags,u16 d);
368#pragma aux neg_word_asm = \
369 "push [edi]" \
370 "popf" \
371 "neg ax" \
372 "pushf" \
373 "pop [edi]" \
374 parm [edi] [ax] \
375 value [ax] \
376 modify exact [ax];
377
378u32 neg_long_asm(u32 *flags,u32 d);
379#pragma aux neg_long_asm = \
380 "push [edi]" \
381 "popf" \
382 "neg eax" \
383 "pushf" \
384 "pop [edi]" \
385 parm [edi] [eax] \
386 value [eax] \
387 modify exact [eax];
388
389u8 not_byte_asm(u32 *flags,u8 d);
390#pragma aux not_byte_asm = \
391 "push [edi]" \
392 "popf" \
393 "not al" \
394 "pushf" \
395 "pop [edi]" \
396 parm [edi] [al] \
397 value [al] \
398 modify exact [al];
399
400u16 not_word_asm(u32 *flags,u16 d);
401#pragma aux not_word_asm = \
402 "push [edi]" \
403 "popf" \
404 "not ax" \
405 "pushf" \
406 "pop [edi]" \
407 parm [edi] [ax] \
408 value [ax] \
409 modify exact [ax];
410
411u32 not_long_asm(u32 *flags,u32 d);
412#pragma aux not_long_asm = \
413 "push [edi]" \
414 "popf" \
415 "not eax" \
416 "pushf" \
417 "pop [edi]" \
418 parm [edi] [eax] \
419 value [eax] \
420 modify exact [eax];
421
422u8 rcl_byte_asm(u32 *flags,u8 d, u8 s);
423#pragma aux rcl_byte_asm = \
424 "push [edi]" \
425 "popf" \
426 "rcl al,cl" \
427 "pushf" \
428 "pop [edi]" \
429 parm [edi] [al] [cl] \
430 value [al] \
431 modify exact [al cl];
432
433u16 rcl_word_asm(u32 *flags,u16 d, u8 s);
434#pragma aux rcl_word_asm = \
435 "push [edi]" \
436 "popf" \
437 "rcl ax,cl" \
438 "pushf" \
439 "pop [edi]" \
440 parm [edi] [ax] [cl] \
441 value [ax] \
442 modify exact [ax cl];
443
444u32 rcl_long_asm(u32 *flags,u32 d, u8 s);
445#pragma aux rcl_long_asm = \
446 "push [edi]" \
447 "popf" \
448 "rcl eax,cl" \
449 "pushf" \
450 "pop [edi]" \
451 parm [edi] [eax] [cl] \
452 value [eax] \
453 modify exact [eax cl];
454
455u8 rcr_byte_asm(u32 *flags,u8 d, u8 s);
456#pragma aux rcr_byte_asm = \
457 "push [edi]" \
458 "popf" \
459 "rcr al,cl" \
460 "pushf" \
461 "pop [edi]" \
462 parm [edi] [al] [cl] \
463 value [al] \
464 modify exact [al cl];
465
466u16 rcr_word_asm(u32 *flags,u16 d, u8 s);
467#pragma aux rcr_word_asm = \
468 "push [edi]" \
469 "popf" \
470 "rcr ax,cl" \
471 "pushf" \
472 "pop [edi]" \
473 parm [edi] [ax] [cl] \
474 value [ax] \
475 modify exact [ax cl];
476
477u32 rcr_long_asm(u32 *flags,u32 d, u8 s);
478#pragma aux rcr_long_asm = \
479 "push [edi]" \
480 "popf" \
481 "rcr eax,cl" \
482 "pushf" \
483 "pop [edi]" \
484 parm [edi] [eax] [cl] \
485 value [eax] \
486 modify exact [eax cl];
487
488u8 rol_byte_asm(u32 *flags,u8 d, u8 s);
489#pragma aux rol_byte_asm = \
490 "push [edi]" \
491 "popf" \
492 "rol al,cl" \
493 "pushf" \
494 "pop [edi]" \
495 parm [edi] [al] [cl] \
496 value [al] \
497 modify exact [al cl];
498
499u16 rol_word_asm(u32 *flags,u16 d, u8 s);
500#pragma aux rol_word_asm = \
501 "push [edi]" \
502 "popf" \
503 "rol ax,cl" \
504 "pushf" \
505 "pop [edi]" \
506 parm [edi] [ax] [cl] \
507 value [ax] \
508 modify exact [ax cl];
509
510u32 rol_long_asm(u32 *flags,u32 d, u8 s);
511#pragma aux rol_long_asm = \
512 "push [edi]" \
513 "popf" \
514 "rol eax,cl" \
515 "pushf" \
516 "pop [edi]" \
517 parm [edi] [eax] [cl] \
518 value [eax] \
519 modify exact [eax cl];
520
521u8 ror_byte_asm(u32 *flags,u8 d, u8 s);
522#pragma aux ror_byte_asm = \
523 "push [edi]" \
524 "popf" \
525 "ror al,cl" \
526 "pushf" \
527 "pop [edi]" \
528 parm [edi] [al] [cl] \
529 value [al] \
530 modify exact [al cl];
531
532u16 ror_word_asm(u32 *flags,u16 d, u8 s);
533#pragma aux ror_word_asm = \
534 "push [edi]" \
535 "popf" \
536 "ror ax,cl" \
537 "pushf" \
538 "pop [edi]" \
539 parm [edi] [ax] [cl] \
540 value [ax] \
541 modify exact [ax cl];
542
543u32 ror_long_asm(u32 *flags,u32 d, u8 s);
544#pragma aux ror_long_asm = \
545 "push [edi]" \
546 "popf" \
547 "ror eax,cl" \
548 "pushf" \
549 "pop [edi]" \
550 parm [edi] [eax] [cl] \
551 value [eax] \
552 modify exact [eax cl];
553
554u8 shl_byte_asm(u32 *flags,u8 d, u8 s);
555#pragma aux shl_byte_asm = \
556 "push [edi]" \
557 "popf" \
558 "shl al,cl" \
559 "pushf" \
560 "pop [edi]" \
561 parm [edi] [al] [cl] \
562 value [al] \
563 modify exact [al cl];
564
565u16 shl_word_asm(u32 *flags,u16 d, u8 s);
566#pragma aux shl_word_asm = \
567 "push [edi]" \
568 "popf" \
569 "shl ax,cl" \
570 "pushf" \
571 "pop [edi]" \
572 parm [edi] [ax] [cl] \
573 value [ax] \
574 modify exact [ax cl];
575
576u32 shl_long_asm(u32 *flags,u32 d, u8 s);
577#pragma aux shl_long_asm = \
578 "push [edi]" \
579 "popf" \
580 "shl eax,cl" \
581 "pushf" \
582 "pop [edi]" \
583 parm [edi] [eax] [cl] \
584 value [eax] \
585 modify exact [eax cl];
586
587u8 shr_byte_asm(u32 *flags,u8 d, u8 s);
588#pragma aux shr_byte_asm = \
589 "push [edi]" \
590 "popf" \
591 "shr al,cl" \
592 "pushf" \
593 "pop [edi]" \
594 parm [edi] [al] [cl] \
595 value [al] \
596 modify exact [al cl];
597
598u16 shr_word_asm(u32 *flags,u16 d, u8 s);
599#pragma aux shr_word_asm = \
600 "push [edi]" \
601 "popf" \
602 "shr ax,cl" \
603 "pushf" \
604 "pop [edi]" \
605 parm [edi] [ax] [cl] \
606 value [ax] \
607 modify exact [ax cl];
608
609u32 shr_long_asm(u32 *flags,u32 d, u8 s);
610#pragma aux shr_long_asm = \
611 "push [edi]" \
612 "popf" \
613 "shr eax,cl" \
614 "pushf" \
615 "pop [edi]" \
616 parm [edi] [eax] [cl] \
617 value [eax] \
618 modify exact [eax cl];
619
620u8 sar_byte_asm(u32 *flags,u8 d, u8 s);
621#pragma aux sar_byte_asm = \
622 "push [edi]" \
623 "popf" \
624 "sar al,cl" \
625 "pushf" \
626 "pop [edi]" \
627 parm [edi] [al] [cl] \
628 value [al] \
629 modify exact [al cl];
630
631u16 sar_word_asm(u32 *flags,u16 d, u8 s);
632#pragma aux sar_word_asm = \
633 "push [edi]" \
634 "popf" \
635 "sar ax,cl" \
636 "pushf" \
637 "pop [edi]" \
638 parm [edi] [ax] [cl] \
639 value [ax] \
640 modify exact [ax cl];
641
642u32 sar_long_asm(u32 *flags,u32 d, u8 s);
643#pragma aux sar_long_asm = \
644 "push [edi]" \
645 "popf" \
646 "sar eax,cl" \
647 "pushf" \
648 "pop [edi]" \
649 parm [edi] [eax] [cl] \
650 value [eax] \
651 modify exact [eax cl];
652
653u16 shld_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
654#pragma aux shld_word_asm = \
655 "push [edi]" \
656 "popf" \
657 "shld ax,dx,cl" \
658 "pushf" \
659 "pop [edi]" \
660 parm [edi] [ax] [dx] [cl] \
661 value [ax] \
662 modify exact [ax dx cl];
663
664u32 shld_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
665#pragma aux shld_long_asm = \
666 "push [edi]" \
667 "popf" \
668 "shld eax,edx,cl" \
669 "pushf" \
670 "pop [edi]" \
671 parm [edi] [eax] [edx] [cl] \
672 value [eax] \
673 modify exact [eax edx cl];
674
675u16 shrd_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
676#pragma aux shrd_word_asm = \
677 "push [edi]" \
678 "popf" \
679 "shrd ax,dx,cl" \
680 "pushf" \
681 "pop [edi]" \
682 parm [edi] [ax] [dx] [cl] \
683 value [ax] \
684 modify exact [ax dx cl];
685
686u32 shrd_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
687#pragma aux shrd_long_asm = \
688 "push [edi]" \
689 "popf" \
690 "shrd eax,edx,cl" \
691 "pushf" \
692 "pop [edi]" \
693 parm [edi] [eax] [edx] [cl] \
694 value [eax] \
695 modify exact [eax edx cl];
696
697u8 sbb_byte_asm(u32 *flags,u8 d, u8 s);
698#pragma aux sbb_byte_asm = \
699 "push [edi]" \
700 "popf" \
701 "sbb al,bl" \
702 "pushf" \
703 "pop [edi]" \
704 parm [edi] [al] [bl] \
705 value [al] \
706 modify exact [al bl];
707
708u16 sbb_word_asm(u32 *flags,u16 d, u16 s);
709#pragma aux sbb_word_asm = \
710 "push [edi]" \
711 "popf" \
712 "sbb ax,bx" \
713 "pushf" \
714 "pop [edi]" \
715 parm [edi] [ax] [bx] \
716 value [ax] \
717 modify exact [ax bx];
718
719u32 sbb_long_asm(u32 *flags,u32 d, u32 s);
720#pragma aux sbb_long_asm = \
721 "push [edi]" \
722 "popf" \
723 "sbb eax,ebx" \
724 "pushf" \
725 "pop [edi]" \
726 parm [edi] [eax] [ebx] \
727 value [eax] \
728 modify exact [eax ebx];
729
730u8 sub_byte_asm(u32 *flags,u8 d, u8 s);
731#pragma aux sub_byte_asm = \
732 "push [edi]" \
733 "popf" \
734 "sub al,bl" \
735 "pushf" \
736 "pop [edi]" \
737 parm [edi] [al] [bl] \
738 value [al] \
739 modify exact [al bl];
740
741u16 sub_word_asm(u32 *flags,u16 d, u16 s);
742#pragma aux sub_word_asm = \
743 "push [edi]" \
744 "popf" \
745 "sub ax,bx" \
746 "pushf" \
747 "pop [edi]" \
748 parm [edi] [ax] [bx] \
749 value [ax] \
750 modify exact [ax bx];
751
752u32 sub_long_asm(u32 *flags,u32 d, u32 s);
753#pragma aux sub_long_asm = \
754 "push [edi]" \
755 "popf" \
756 "sub eax,ebx" \
757 "pushf" \
758 "pop [edi]" \
759 parm [edi] [eax] [ebx] \
760 value [eax] \
761 modify exact [eax ebx];
762
763void test_byte_asm(u32 *flags,u8 d, u8 s);
764#pragma aux test_byte_asm = \
765 "push [edi]" \
766 "popf" \
767 "test al,bl" \
768 "pushf" \
769 "pop [edi]" \
770 parm [edi] [al] [bl] \
771 modify exact [al bl];
772
773void test_word_asm(u32 *flags,u16 d, u16 s);
774#pragma aux test_word_asm = \
775 "push [edi]" \
776 "popf" \
777 "test ax,bx" \
778 "pushf" \
779 "pop [edi]" \
780 parm [edi] [ax] [bx] \
781 modify exact [ax bx];
782
783void test_long_asm(u32 *flags,u32 d, u32 s);
784#pragma aux test_long_asm = \
785 "push [edi]" \
786 "popf" \
787 "test eax,ebx" \
788 "pushf" \
789 "pop [edi]" \
790 parm [edi] [eax] [ebx] \
791 modify exact [eax ebx];
792
793u8 xor_byte_asm(u32 *flags,u8 d, u8 s);
794#pragma aux xor_byte_asm = \
795 "push [edi]" \
796 "popf" \
797 "xor al,bl" \
798 "pushf" \
799 "pop [edi]" \
800 parm [edi] [al] [bl] \
801 value [al] \
802 modify exact [al bl];
803
804u16 xor_word_asm(u32 *flags,u16 d, u16 s);
805#pragma aux xor_word_asm = \
806 "push [edi]" \
807 "popf" \
808 "xor ax,bx" \
809 "pushf" \
810 "pop [edi]" \
811 parm [edi] [ax] [bx] \
812 value [ax] \
813 modify exact [ax bx];
814
815u32 xor_long_asm(u32 *flags,u32 d, u32 s);
816#pragma aux xor_long_asm = \
817 "push [edi]" \
818 "popf" \
819 "xor eax,ebx" \
820 "pushf" \
821 "pop [edi]" \
822 parm [edi] [eax] [ebx] \
823 value [eax] \
824 modify exact [eax ebx];
825
826void imul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
827#pragma aux imul_byte_asm = \
828 "push [edi]" \
829 "popf" \
830 "imul bl" \
831 "pushf" \
832 "pop [edi]" \
833 "mov [esi],ax" \
834 parm [edi] [esi] [al] [bl] \
835 modify exact [esi ax bl];
836
837void imul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
838#pragma aux imul_word_asm = \
839 "push [edi]" \
840 "popf" \
841 "imul bx" \
842 "pushf" \
843 "pop [edi]" \
844 "mov [esi],ax" \
845 "mov [ecx],dx" \
846 parm [edi] [esi] [ecx] [ax] [bx]\
847 modify exact [esi edi ax bx dx];
848
849void imul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
850#pragma aux imul_long_asm = \
851 "push [edi]" \
852 "popf" \
853 "imul ebx" \
854 "pushf" \
855 "pop [edi]" \
856 "mov [esi],eax" \
857 "mov [ecx],edx" \
858 parm [edi] [esi] [ecx] [eax] [ebx] \
859 modify exact [esi edi eax ebx edx];
860
861void mul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
862#pragma aux mul_byte_asm = \
863 "push [edi]" \
864 "popf" \
865 "mul bl" \
866 "pushf" \
867 "pop [edi]" \
868 "mov [esi],ax" \
869 parm [edi] [esi] [al] [bl] \
870 modify exact [esi ax bl];
871
872void mul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
873#pragma aux mul_word_asm = \
874 "push [edi]" \
875 "popf" \
876 "mul bx" \
877 "pushf" \
878 "pop [edi]" \
879 "mov [esi],ax" \
880 "mov [ecx],dx" \
881 parm [edi] [esi] [ecx] [ax] [bx]\
882 modify exact [esi edi ax bx dx];
883
884void mul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
885#pragma aux mul_long_asm = \
886 "push [edi]" \
887 "popf" \
888 "mul ebx" \
889 "pushf" \
890 "pop [edi]" \
891 "mov [esi],eax" \
892 "mov [ecx],edx" \
893 parm [edi] [esi] [ecx] [eax] [ebx] \
894 modify exact [esi edi eax ebx edx];
895
896void idiv_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
897#pragma aux idiv_byte_asm = \
898 "push [edi]" \
899 "popf" \
900 "idiv bl" \
901 "pushf" \
902 "pop [edi]" \
903 "mov [esi],al" \
904 "mov [ecx],ah" \
905 parm [edi] [esi] [ecx] [ax] [bl]\
906 modify exact [esi edi ax bl];
907
908void idiv_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
909#pragma aux idiv_word_asm = \
910 "push [edi]" \
911 "popf" \
912 "idiv bx" \
913 "pushf" \
914 "pop [edi]" \
915 "mov [esi],ax" \
916 "mov [ecx],dx" \
917 parm [edi] [esi] [ecx] [ax] [dx] [bx]\
918 modify exact [esi edi ax dx bx];
919
920void idiv_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
921#pragma aux idiv_long_asm = \
922 "push [edi]" \
923 "popf" \
924 "idiv ebx" \
925 "pushf" \
926 "pop [edi]" \
927 "mov [esi],eax" \
928 "mov [ecx],edx" \
929 parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
930 modify exact [esi edi eax edx ebx];
931
932void div_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
933#pragma aux div_byte_asm = \
934 "push [edi]" \
935 "popf" \
936 "div bl" \
937 "pushf" \
938 "pop [edi]" \
939 "mov [esi],al" \
940 "mov [ecx],ah" \
941 parm [edi] [esi] [ecx] [ax] [bl]\
942 modify exact [esi edi ax bl];
943
944void div_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
945#pragma aux div_word_asm = \
946 "push [edi]" \
947 "popf" \
948 "div bx" \
949 "pushf" \
950 "pop [edi]" \
951 "mov [esi],ax" \
952 "mov [ecx],dx" \
953 parm [edi] [esi] [ecx] [ax] [dx] [bx]\
954 modify exact [esi edi ax dx bx];
955
956void div_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
957#pragma aux div_long_asm = \
958 "push [edi]" \
959 "popf" \
960 "div ebx" \
961 "pushf" \
962 "pop [edi]" \
963 "mov [esi],eax" \
964 "mov [ecx],edx" \
965 parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
966 modify exact [esi edi eax edx ebx];
967
968#endif
969
970#endif /* __X86EMU_PRIM_ASM_H */