libhd 5.0
|
00001 /**************************************************************************** 00002 * 00003 * Realmode X86 Emulator Library 00004 * 00005 * Copyright (C) 1996-1999 SciTech Software, Inc. 00006 * Copyright (C) David Mosberger-Tang 00007 * Copyright (C) 1999 Egbert Eich 00008 * 00009 * ======================================================================== 00010 * 00011 * Permission to use, copy, modify, distribute, and sell this software and 00012 * its documentation for any purpose is hereby granted without fee, 00013 * provided that the above copyright notice appear in all copies and that 00014 * both that copyright notice and this permission notice appear in 00015 * supporting documentation, and that the name of the authors not be used 00016 * in advertising or publicity pertaining to distribution of the software 00017 * without specific, written prior permission. The authors makes no 00018 * representations about the suitability of this software for any purpose. 00019 * It is provided "as is" without express or implied warranty. 00020 * 00021 * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 00022 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 00023 * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR 00024 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 00025 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00026 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00027 * PERFORMANCE OF THIS SOFTWARE. 00028 * 00029 * ======================================================================== 00030 * 00031 * Language: Watcom C++ 10.6 or later 00032 * Environment: Any 00033 * Developer: Kendall Bennett 00034 * 00035 * Description: Inline assembler versions of the primitive operand 00036 * functions for faster performance. At the moment this is 00037 * x86 inline assembler, but these functions could be replaced 00038 * with native inline assembler for each supported processor 00039 * platform. 00040 * 00041 ****************************************************************************/ 00042 /* $XFree86$ */ 00043 00044 #ifndef __X86EMU_PRIM_ASM_H 00045 #define __X86EMU_PRIM_ASM_H 00046 00047 #ifdef __WATCOMC__ 00048 00049 #ifndef VALIDATE 00050 #define __HAVE_INLINE_ASSEMBLER__ 00051 #endif 00052 00053 u32 get_flags_asm(void); 00054 #pragma aux get_flags_asm = \ 00055 "pushf" \ 00056 "pop eax" \ 00057 value [eax] \ 00058 modify exact [eax]; 00059 00060 u16 aaa_word_asm(u32 *flags,u16 d); 00061 #pragma aux aaa_word_asm = \ 00062 "push [edi]" \ 00063 "popf" \ 00064 "aaa" \ 00065 "pushf" \ 00066 "pop [edi]" \ 00067 parm [edi] [ax] \ 00068 value [ax] \ 00069 modify exact [ax]; 00070 00071 u16 aas_word_asm(u32 *flags,u16 d); 00072 #pragma aux aas_word_asm = \ 00073 "push [edi]" \ 00074 "popf" \ 00075 "aas" \ 00076 "pushf" \ 00077 "pop [edi]" \ 00078 parm [edi] [ax] \ 00079 value [ax] \ 00080 modify exact [ax]; 00081 00082 u16 aad_word_asm(u32 *flags,u16 d); 00083 #pragma aux aad_word_asm = \ 00084 "push [edi]" \ 00085 "popf" \ 00086 "aad" \ 00087 "pushf" \ 00088 "pop [edi]" \ 00089 parm [edi] [ax] \ 00090 value [ax] \ 00091 modify exact [ax]; 00092 00093 u16 aam_word_asm(u32 *flags,u8 d); 00094 #pragma aux aam_word_asm = \ 00095 "push [edi]" \ 00096 "popf" \ 00097 "aam" \ 00098 "pushf" \ 00099 "pop [edi]" \ 00100 parm [edi] [al] \ 00101 value [ax] \ 00102 modify exact [ax]; 00103 00104 u8 adc_byte_asm(u32 *flags,u8 d, u8 s); 00105 #pragma aux adc_byte_asm = \ 00106 "push [edi]" \ 00107 "popf" \ 00108 "adc al,bl" \ 00109 "pushf" \ 00110 "pop [edi]" \ 00111 parm [edi] [al] [bl] \ 00112 value [al] \ 00113 modify exact [al bl]; 00114 00115 u16 adc_word_asm(u32 *flags,u16 d, u16 s); 00116 #pragma aux adc_word_asm = \ 00117 "push [edi]" \ 00118 "popf" \ 00119 "adc ax,bx" \ 00120 "pushf" \ 00121 "pop [edi]" \ 00122 parm [edi] [ax] [bx] \ 00123 value [ax] \ 00124 modify exact [ax bx]; 00125 00126 u32 adc_long_asm(u32 *flags,u32 d, u32 s); 00127 #pragma aux adc_long_asm = \ 00128 "push [edi]" \ 00129 "popf" \ 00130 "adc eax,ebx" \ 00131 "pushf" \ 00132 "pop [edi]" \ 00133 parm [edi] [eax] [ebx] \ 00134 value [eax] \ 00135 modify exact [eax ebx]; 00136 00137 u8 add_byte_asm(u32 *flags,u8 d, u8 s); 00138 #pragma aux add_byte_asm = \ 00139 "push [edi]" \ 00140 "popf" \ 00141 "add al,bl" \ 00142 "pushf" \ 00143 "pop [edi]" \ 00144 parm [edi] [al] [bl] \ 00145 value [al] \ 00146 modify exact [al bl]; 00147 00148 u16 add_word_asm(u32 *flags,u16 d, u16 s); 00149 #pragma aux add_word_asm = \ 00150 "push [edi]" \ 00151 "popf" \ 00152 "add ax,bx" \ 00153 "pushf" \ 00154 "pop [edi]" \ 00155 parm [edi] [ax] [bx] \ 00156 value [ax] \ 00157 modify exact [ax bx]; 00158 00159 u32 add_long_asm(u32 *flags,u32 d, u32 s); 00160 #pragma aux add_long_asm = \ 00161 "push [edi]" \ 00162 "popf" \ 00163 "add eax,ebx" \ 00164 "pushf" \ 00165 "pop [edi]" \ 00166 parm [edi] [eax] [ebx] \ 00167 value [eax] \ 00168 modify exact [eax ebx]; 00169 00170 u8 and_byte_asm(u32 *flags,u8 d, u8 s); 00171 #pragma aux and_byte_asm = \ 00172 "push [edi]" \ 00173 "popf" \ 00174 "and al,bl" \ 00175 "pushf" \ 00176 "pop [edi]" \ 00177 parm [edi] [al] [bl] \ 00178 value [al] \ 00179 modify exact [al bl]; 00180 00181 u16 and_word_asm(u32 *flags,u16 d, u16 s); 00182 #pragma aux and_word_asm = \ 00183 "push [edi]" \ 00184 "popf" \ 00185 "and ax,bx" \ 00186 "pushf" \ 00187 "pop [edi]" \ 00188 parm [edi] [ax] [bx] \ 00189 value [ax] \ 00190 modify exact [ax bx]; 00191 00192 u32 and_long_asm(u32 *flags,u32 d, u32 s); 00193 #pragma aux and_long_asm = \ 00194 "push [edi]" \ 00195 "popf" \ 00196 "and eax,ebx" \ 00197 "pushf" \ 00198 "pop [edi]" \ 00199 parm [edi] [eax] [ebx] \ 00200 value [eax] \ 00201 modify exact [eax ebx]; 00202 00203 u8 cmp_byte_asm(u32 *flags,u8 d, u8 s); 00204 #pragma aux cmp_byte_asm = \ 00205 "push [edi]" \ 00206 "popf" \ 00207 "cmp al,bl" \ 00208 "pushf" \ 00209 "pop [edi]" \ 00210 parm [edi] [al] [bl] \ 00211 value [al] \ 00212 modify exact [al bl]; 00213 00214 u16 cmp_word_asm(u32 *flags,u16 d, u16 s); 00215 #pragma aux cmp_word_asm = \ 00216 "push [edi]" \ 00217 "popf" \ 00218 "cmp ax,bx" \ 00219 "pushf" \ 00220 "pop [edi]" \ 00221 parm [edi] [ax] [bx] \ 00222 value [ax] \ 00223 modify exact [ax bx]; 00224 00225 u32 cmp_long_asm(u32 *flags,u32 d, u32 s); 00226 #pragma aux cmp_long_asm = \ 00227 "push [edi]" \ 00228 "popf" \ 00229 "cmp eax,ebx" \ 00230 "pushf" \ 00231 "pop [edi]" \ 00232 parm [edi] [eax] [ebx] \ 00233 value [eax] \ 00234 modify exact [eax ebx]; 00235 00236 u8 daa_byte_asm(u32 *flags,u8 d); 00237 #pragma aux daa_byte_asm = \ 00238 "push [edi]" \ 00239 "popf" \ 00240 "daa" \ 00241 "pushf" \ 00242 "pop [edi]" \ 00243 parm [edi] [al] \ 00244 value [al] \ 00245 modify exact [al]; 00246 00247 u8 das_byte_asm(u32 *flags,u8 d); 00248 #pragma aux das_byte_asm = \ 00249 "push [edi]" \ 00250 "popf" \ 00251 "das" \ 00252 "pushf" \ 00253 "pop [edi]" \ 00254 parm [edi] [al] \ 00255 value [al] \ 00256 modify exact [al]; 00257 00258 u8 dec_byte_asm(u32 *flags,u8 d); 00259 #pragma aux dec_byte_asm = \ 00260 "push [edi]" \ 00261 "popf" \ 00262 "dec al" \ 00263 "pushf" \ 00264 "pop [edi]" \ 00265 parm [edi] [al] \ 00266 value [al] \ 00267 modify exact [al]; 00268 00269 u16 dec_word_asm(u32 *flags,u16 d); 00270 #pragma aux dec_word_asm = \ 00271 "push [edi]" \ 00272 "popf" \ 00273 "dec ax" \ 00274 "pushf" \ 00275 "pop [edi]" \ 00276 parm [edi] [ax] \ 00277 value [ax] \ 00278 modify exact [ax]; 00279 00280 u32 dec_long_asm(u32 *flags,u32 d); 00281 #pragma aux dec_long_asm = \ 00282 "push [edi]" \ 00283 "popf" \ 00284 "dec eax" \ 00285 "pushf" \ 00286 "pop [edi]" \ 00287 parm [edi] [eax] \ 00288 value [eax] \ 00289 modify exact [eax]; 00290 00291 u8 inc_byte_asm(u32 *flags,u8 d); 00292 #pragma aux inc_byte_asm = \ 00293 "push [edi]" \ 00294 "popf" \ 00295 "inc al" \ 00296 "pushf" \ 00297 "pop [edi]" \ 00298 parm [edi] [al] \ 00299 value [al] \ 00300 modify exact [al]; 00301 00302 u16 inc_word_asm(u32 *flags,u16 d); 00303 #pragma aux inc_word_asm = \ 00304 "push [edi]" \ 00305 "popf" \ 00306 "inc ax" \ 00307 "pushf" \ 00308 "pop [edi]" \ 00309 parm [edi] [ax] \ 00310 value [ax] \ 00311 modify exact [ax]; 00312 00313 u32 inc_long_asm(u32 *flags,u32 d); 00314 #pragma aux inc_long_asm = \ 00315 "push [edi]" \ 00316 "popf" \ 00317 "inc eax" \ 00318 "pushf" \ 00319 "pop [edi]" \ 00320 parm [edi] [eax] \ 00321 value [eax] \ 00322 modify exact [eax]; 00323 00324 u8 or_byte_asm(u32 *flags,u8 d, u8 s); 00325 #pragma aux or_byte_asm = \ 00326 "push [edi]" \ 00327 "popf" \ 00328 "or al,bl" \ 00329 "pushf" \ 00330 "pop [edi]" \ 00331 parm [edi] [al] [bl] \ 00332 value [al] \ 00333 modify exact [al bl]; 00334 00335 u16 or_word_asm(u32 *flags,u16 d, u16 s); 00336 #pragma aux or_word_asm = \ 00337 "push [edi]" \ 00338 "popf" \ 00339 "or ax,bx" \ 00340 "pushf" \ 00341 "pop [edi]" \ 00342 parm [edi] [ax] [bx] \ 00343 value [ax] \ 00344 modify exact [ax bx]; 00345 00346 u32 or_long_asm(u32 *flags,u32 d, u32 s); 00347 #pragma aux or_long_asm = \ 00348 "push [edi]" \ 00349 "popf" \ 00350 "or eax,ebx" \ 00351 "pushf" \ 00352 "pop [edi]" \ 00353 parm [edi] [eax] [ebx] \ 00354 value [eax] \ 00355 modify exact [eax ebx]; 00356 00357 u8 neg_byte_asm(u32 *flags,u8 d); 00358 #pragma aux neg_byte_asm = \ 00359 "push [edi]" \ 00360 "popf" \ 00361 "neg al" \ 00362 "pushf" \ 00363 "pop [edi]" \ 00364 parm [edi] [al] \ 00365 value [al] \ 00366 modify exact [al]; 00367 00368 u16 neg_word_asm(u32 *flags,u16 d); 00369 #pragma aux neg_word_asm = \ 00370 "push [edi]" \ 00371 "popf" \ 00372 "neg ax" \ 00373 "pushf" \ 00374 "pop [edi]" \ 00375 parm [edi] [ax] \ 00376 value [ax] \ 00377 modify exact [ax]; 00378 00379 u32 neg_long_asm(u32 *flags,u32 d); 00380 #pragma aux neg_long_asm = \ 00381 "push [edi]" \ 00382 "popf" \ 00383 "neg eax" \ 00384 "pushf" \ 00385 "pop [edi]" \ 00386 parm [edi] [eax] \ 00387 value [eax] \ 00388 modify exact [eax]; 00389 00390 u8 not_byte_asm(u32 *flags,u8 d); 00391 #pragma aux not_byte_asm = \ 00392 "push [edi]" \ 00393 "popf" \ 00394 "not al" \ 00395 "pushf" \ 00396 "pop [edi]" \ 00397 parm [edi] [al] \ 00398 value [al] \ 00399 modify exact [al]; 00400 00401 u16 not_word_asm(u32 *flags,u16 d); 00402 #pragma aux not_word_asm = \ 00403 "push [edi]" \ 00404 "popf" \ 00405 "not ax" \ 00406 "pushf" \ 00407 "pop [edi]" \ 00408 parm [edi] [ax] \ 00409 value [ax] \ 00410 modify exact [ax]; 00411 00412 u32 not_long_asm(u32 *flags,u32 d); 00413 #pragma aux not_long_asm = \ 00414 "push [edi]" \ 00415 "popf" \ 00416 "not eax" \ 00417 "pushf" \ 00418 "pop [edi]" \ 00419 parm [edi] [eax] \ 00420 value [eax] \ 00421 modify exact [eax]; 00422 00423 u8 rcl_byte_asm(u32 *flags,u8 d, u8 s); 00424 #pragma aux rcl_byte_asm = \ 00425 "push [edi]" \ 00426 "popf" \ 00427 "rcl al,cl" \ 00428 "pushf" \ 00429 "pop [edi]" \ 00430 parm [edi] [al] [cl] \ 00431 value [al] \ 00432 modify exact [al cl]; 00433 00434 u16 rcl_word_asm(u32 *flags,u16 d, u8 s); 00435 #pragma aux rcl_word_asm = \ 00436 "push [edi]" \ 00437 "popf" \ 00438 "rcl ax,cl" \ 00439 "pushf" \ 00440 "pop [edi]" \ 00441 parm [edi] [ax] [cl] \ 00442 value [ax] \ 00443 modify exact [ax cl]; 00444 00445 u32 rcl_long_asm(u32 *flags,u32 d, u8 s); 00446 #pragma aux rcl_long_asm = \ 00447 "push [edi]" \ 00448 "popf" \ 00449 "rcl eax,cl" \ 00450 "pushf" \ 00451 "pop [edi]" \ 00452 parm [edi] [eax] [cl] \ 00453 value [eax] \ 00454 modify exact [eax cl]; 00455 00456 u8 rcr_byte_asm(u32 *flags,u8 d, u8 s); 00457 #pragma aux rcr_byte_asm = \ 00458 "push [edi]" \ 00459 "popf" \ 00460 "rcr al,cl" \ 00461 "pushf" \ 00462 "pop [edi]" \ 00463 parm [edi] [al] [cl] \ 00464 value [al] \ 00465 modify exact [al cl]; 00466 00467 u16 rcr_word_asm(u32 *flags,u16 d, u8 s); 00468 #pragma aux rcr_word_asm = \ 00469 "push [edi]" \ 00470 "popf" \ 00471 "rcr ax,cl" \ 00472 "pushf" \ 00473 "pop [edi]" \ 00474 parm [edi] [ax] [cl] \ 00475 value [ax] \ 00476 modify exact [ax cl]; 00477 00478 u32 rcr_long_asm(u32 *flags,u32 d, u8 s); 00479 #pragma aux rcr_long_asm = \ 00480 "push [edi]" \ 00481 "popf" \ 00482 "rcr eax,cl" \ 00483 "pushf" \ 00484 "pop [edi]" \ 00485 parm [edi] [eax] [cl] \ 00486 value [eax] \ 00487 modify exact [eax cl]; 00488 00489 u8 rol_byte_asm(u32 *flags,u8 d, u8 s); 00490 #pragma aux rol_byte_asm = \ 00491 "push [edi]" \ 00492 "popf" \ 00493 "rol al,cl" \ 00494 "pushf" \ 00495 "pop [edi]" \ 00496 parm [edi] [al] [cl] \ 00497 value [al] \ 00498 modify exact [al cl]; 00499 00500 u16 rol_word_asm(u32 *flags,u16 d, u8 s); 00501 #pragma aux rol_word_asm = \ 00502 "push [edi]" \ 00503 "popf" \ 00504 "rol ax,cl" \ 00505 "pushf" \ 00506 "pop [edi]" \ 00507 parm [edi] [ax] [cl] \ 00508 value [ax] \ 00509 modify exact [ax cl]; 00510 00511 u32 rol_long_asm(u32 *flags,u32 d, u8 s); 00512 #pragma aux rol_long_asm = \ 00513 "push [edi]" \ 00514 "popf" \ 00515 "rol eax,cl" \ 00516 "pushf" \ 00517 "pop [edi]" \ 00518 parm [edi] [eax] [cl] \ 00519 value [eax] \ 00520 modify exact [eax cl]; 00521 00522 u8 ror_byte_asm(u32 *flags,u8 d, u8 s); 00523 #pragma aux ror_byte_asm = \ 00524 "push [edi]" \ 00525 "popf" \ 00526 "ror al,cl" \ 00527 "pushf" \ 00528 "pop [edi]" \ 00529 parm [edi] [al] [cl] \ 00530 value [al] \ 00531 modify exact [al cl]; 00532 00533 u16 ror_word_asm(u32 *flags,u16 d, u8 s); 00534 #pragma aux ror_word_asm = \ 00535 "push [edi]" \ 00536 "popf" \ 00537 "ror ax,cl" \ 00538 "pushf" \ 00539 "pop [edi]" \ 00540 parm [edi] [ax] [cl] \ 00541 value [ax] \ 00542 modify exact [ax cl]; 00543 00544 u32 ror_long_asm(u32 *flags,u32 d, u8 s); 00545 #pragma aux ror_long_asm = \ 00546 "push [edi]" \ 00547 "popf" \ 00548 "ror eax,cl" \ 00549 "pushf" \ 00550 "pop [edi]" \ 00551 parm [edi] [eax] [cl] \ 00552 value [eax] \ 00553 modify exact [eax cl]; 00554 00555 u8 shl_byte_asm(u32 *flags,u8 d, u8 s); 00556 #pragma aux shl_byte_asm = \ 00557 "push [edi]" \ 00558 "popf" \ 00559 "shl al,cl" \ 00560 "pushf" \ 00561 "pop [edi]" \ 00562 parm [edi] [al] [cl] \ 00563 value [al] \ 00564 modify exact [al cl]; 00565 00566 u16 shl_word_asm(u32 *flags,u16 d, u8 s); 00567 #pragma aux shl_word_asm = \ 00568 "push [edi]" \ 00569 "popf" \ 00570 "shl ax,cl" \ 00571 "pushf" \ 00572 "pop [edi]" \ 00573 parm [edi] [ax] [cl] \ 00574 value [ax] \ 00575 modify exact [ax cl]; 00576 00577 u32 shl_long_asm(u32 *flags,u32 d, u8 s); 00578 #pragma aux shl_long_asm = \ 00579 "push [edi]" \ 00580 "popf" \ 00581 "shl eax,cl" \ 00582 "pushf" \ 00583 "pop [edi]" \ 00584 parm [edi] [eax] [cl] \ 00585 value [eax] \ 00586 modify exact [eax cl]; 00587 00588 u8 shr_byte_asm(u32 *flags,u8 d, u8 s); 00589 #pragma aux shr_byte_asm = \ 00590 "push [edi]" \ 00591 "popf" \ 00592 "shr al,cl" \ 00593 "pushf" \ 00594 "pop [edi]" \ 00595 parm [edi] [al] [cl] \ 00596 value [al] \ 00597 modify exact [al cl]; 00598 00599 u16 shr_word_asm(u32 *flags,u16 d, u8 s); 00600 #pragma aux shr_word_asm = \ 00601 "push [edi]" \ 00602 "popf" \ 00603 "shr ax,cl" \ 00604 "pushf" \ 00605 "pop [edi]" \ 00606 parm [edi] [ax] [cl] \ 00607 value [ax] \ 00608 modify exact [ax cl]; 00609 00610 u32 shr_long_asm(u32 *flags,u32 d, u8 s); 00611 #pragma aux shr_long_asm = \ 00612 "push [edi]" \ 00613 "popf" \ 00614 "shr eax,cl" \ 00615 "pushf" \ 00616 "pop [edi]" \ 00617 parm [edi] [eax] [cl] \ 00618 value [eax] \ 00619 modify exact [eax cl]; 00620 00621 u8 sar_byte_asm(u32 *flags,u8 d, u8 s); 00622 #pragma aux sar_byte_asm = \ 00623 "push [edi]" \ 00624 "popf" \ 00625 "sar al,cl" \ 00626 "pushf" \ 00627 "pop [edi]" \ 00628 parm [edi] [al] [cl] \ 00629 value [al] \ 00630 modify exact [al cl]; 00631 00632 u16 sar_word_asm(u32 *flags,u16 d, u8 s); 00633 #pragma aux sar_word_asm = \ 00634 "push [edi]" \ 00635 "popf" \ 00636 "sar ax,cl" \ 00637 "pushf" \ 00638 "pop [edi]" \ 00639 parm [edi] [ax] [cl] \ 00640 value [ax] \ 00641 modify exact [ax cl]; 00642 00643 u32 sar_long_asm(u32 *flags,u32 d, u8 s); 00644 #pragma aux sar_long_asm = \ 00645 "push [edi]" \ 00646 "popf" \ 00647 "sar eax,cl" \ 00648 "pushf" \ 00649 "pop [edi]" \ 00650 parm [edi] [eax] [cl] \ 00651 value [eax] \ 00652 modify exact [eax cl]; 00653 00654 u16 shld_word_asm(u32 *flags,u16 d, u16 fill, u8 s); 00655 #pragma aux shld_word_asm = \ 00656 "push [edi]" \ 00657 "popf" \ 00658 "shld ax,dx,cl" \ 00659 "pushf" \ 00660 "pop [edi]" \ 00661 parm [edi] [ax] [dx] [cl] \ 00662 value [ax] \ 00663 modify exact [ax dx cl]; 00664 00665 u32 shld_long_asm(u32 *flags,u32 d, u32 fill, u8 s); 00666 #pragma aux shld_long_asm = \ 00667 "push [edi]" \ 00668 "popf" \ 00669 "shld eax,edx,cl" \ 00670 "pushf" \ 00671 "pop [edi]" \ 00672 parm [edi] [eax] [edx] [cl] \ 00673 value [eax] \ 00674 modify exact [eax edx cl]; 00675 00676 u16 shrd_word_asm(u32 *flags,u16 d, u16 fill, u8 s); 00677 #pragma aux shrd_word_asm = \ 00678 "push [edi]" \ 00679 "popf" \ 00680 "shrd ax,dx,cl" \ 00681 "pushf" \ 00682 "pop [edi]" \ 00683 parm [edi] [ax] [dx] [cl] \ 00684 value [ax] \ 00685 modify exact [ax dx cl]; 00686 00687 u32 shrd_long_asm(u32 *flags,u32 d, u32 fill, u8 s); 00688 #pragma aux shrd_long_asm = \ 00689 "push [edi]" \ 00690 "popf" \ 00691 "shrd eax,edx,cl" \ 00692 "pushf" \ 00693 "pop [edi]" \ 00694 parm [edi] [eax] [edx] [cl] \ 00695 value [eax] \ 00696 modify exact [eax edx cl]; 00697 00698 u8 sbb_byte_asm(u32 *flags,u8 d, u8 s); 00699 #pragma aux sbb_byte_asm = \ 00700 "push [edi]" \ 00701 "popf" \ 00702 "sbb al,bl" \ 00703 "pushf" \ 00704 "pop [edi]" \ 00705 parm [edi] [al] [bl] \ 00706 value [al] \ 00707 modify exact [al bl]; 00708 00709 u16 sbb_word_asm(u32 *flags,u16 d, u16 s); 00710 #pragma aux sbb_word_asm = \ 00711 "push [edi]" \ 00712 "popf" \ 00713 "sbb ax,bx" \ 00714 "pushf" \ 00715 "pop [edi]" \ 00716 parm [edi] [ax] [bx] \ 00717 value [ax] \ 00718 modify exact [ax bx]; 00719 00720 u32 sbb_long_asm(u32 *flags,u32 d, u32 s); 00721 #pragma aux sbb_long_asm = \ 00722 "push [edi]" \ 00723 "popf" \ 00724 "sbb eax,ebx" \ 00725 "pushf" \ 00726 "pop [edi]" \ 00727 parm [edi] [eax] [ebx] \ 00728 value [eax] \ 00729 modify exact [eax ebx]; 00730 00731 u8 sub_byte_asm(u32 *flags,u8 d, u8 s); 00732 #pragma aux sub_byte_asm = \ 00733 "push [edi]" \ 00734 "popf" \ 00735 "sub al,bl" \ 00736 "pushf" \ 00737 "pop [edi]" \ 00738 parm [edi] [al] [bl] \ 00739 value [al] \ 00740 modify exact [al bl]; 00741 00742 u16 sub_word_asm(u32 *flags,u16 d, u16 s); 00743 #pragma aux sub_word_asm = \ 00744 "push [edi]" \ 00745 "popf" \ 00746 "sub ax,bx" \ 00747 "pushf" \ 00748 "pop [edi]" \ 00749 parm [edi] [ax] [bx] \ 00750 value [ax] \ 00751 modify exact [ax bx]; 00752 00753 u32 sub_long_asm(u32 *flags,u32 d, u32 s); 00754 #pragma aux sub_long_asm = \ 00755 "push [edi]" \ 00756 "popf" \ 00757 "sub eax,ebx" \ 00758 "pushf" \ 00759 "pop [edi]" \ 00760 parm [edi] [eax] [ebx] \ 00761 value [eax] \ 00762 modify exact [eax ebx]; 00763 00764 void test_byte_asm(u32 *flags,u8 d, u8 s); 00765 #pragma aux test_byte_asm = \ 00766 "push [edi]" \ 00767 "popf" \ 00768 "test al,bl" \ 00769 "pushf" \ 00770 "pop [edi]" \ 00771 parm [edi] [al] [bl] \ 00772 modify exact [al bl]; 00773 00774 void test_word_asm(u32 *flags,u16 d, u16 s); 00775 #pragma aux test_word_asm = \ 00776 "push [edi]" \ 00777 "popf" \ 00778 "test ax,bx" \ 00779 "pushf" \ 00780 "pop [edi]" \ 00781 parm [edi] [ax] [bx] \ 00782 modify exact [ax bx]; 00783 00784 void test_long_asm(u32 *flags,u32 d, u32 s); 00785 #pragma aux test_long_asm = \ 00786 "push [edi]" \ 00787 "popf" \ 00788 "test eax,ebx" \ 00789 "pushf" \ 00790 "pop [edi]" \ 00791 parm [edi] [eax] [ebx] \ 00792 modify exact [eax ebx]; 00793 00794 u8 xor_byte_asm(u32 *flags,u8 d, u8 s); 00795 #pragma aux xor_byte_asm = \ 00796 "push [edi]" \ 00797 "popf" \ 00798 "xor al,bl" \ 00799 "pushf" \ 00800 "pop [edi]" \ 00801 parm [edi] [al] [bl] \ 00802 value [al] \ 00803 modify exact [al bl]; 00804 00805 u16 xor_word_asm(u32 *flags,u16 d, u16 s); 00806 #pragma aux xor_word_asm = \ 00807 "push [edi]" \ 00808 "popf" \ 00809 "xor ax,bx" \ 00810 "pushf" \ 00811 "pop [edi]" \ 00812 parm [edi] [ax] [bx] \ 00813 value [ax] \ 00814 modify exact [ax bx]; 00815 00816 u32 xor_long_asm(u32 *flags,u32 d, u32 s); 00817 #pragma aux xor_long_asm = \ 00818 "push [edi]" \ 00819 "popf" \ 00820 "xor eax,ebx" \ 00821 "pushf" \ 00822 "pop [edi]" \ 00823 parm [edi] [eax] [ebx] \ 00824 value [eax] \ 00825 modify exact [eax ebx]; 00826 00827 void imul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s); 00828 #pragma aux imul_byte_asm = \ 00829 "push [edi]" \ 00830 "popf" \ 00831 "imul bl" \ 00832 "pushf" \ 00833 "pop [edi]" \ 00834 "mov [esi],ax" \ 00835 parm [edi] [esi] [al] [bl] \ 00836 modify exact [esi ax bl]; 00837 00838 void imul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s); 00839 #pragma aux imul_word_asm = \ 00840 "push [edi]" \ 00841 "popf" \ 00842 "imul bx" \ 00843 "pushf" \ 00844 "pop [edi]" \ 00845 "mov [esi],ax" \ 00846 "mov [ecx],dx" \ 00847 parm [edi] [esi] [ecx] [ax] [bx]\ 00848 modify exact [esi edi ax bx dx]; 00849 00850 void imul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s); 00851 #pragma aux imul_long_asm = \ 00852 "push [edi]" \ 00853 "popf" \ 00854 "imul ebx" \ 00855 "pushf" \ 00856 "pop [edi]" \ 00857 "mov [esi],eax" \ 00858 "mov [ecx],edx" \ 00859 parm [edi] [esi] [ecx] [eax] [ebx] \ 00860 modify exact [esi edi eax ebx edx]; 00861 00862 void mul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s); 00863 #pragma aux mul_byte_asm = \ 00864 "push [edi]" \ 00865 "popf" \ 00866 "mul bl" \ 00867 "pushf" \ 00868 "pop [edi]" \ 00869 "mov [esi],ax" \ 00870 parm [edi] [esi] [al] [bl] \ 00871 modify exact [esi ax bl]; 00872 00873 void mul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s); 00874 #pragma aux mul_word_asm = \ 00875 "push [edi]" \ 00876 "popf" \ 00877 "mul bx" \ 00878 "pushf" \ 00879 "pop [edi]" \ 00880 "mov [esi],ax" \ 00881 "mov [ecx],dx" \ 00882 parm [edi] [esi] [ecx] [ax] [bx]\ 00883 modify exact [esi edi ax bx dx]; 00884 00885 void mul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s); 00886 #pragma aux mul_long_asm = \ 00887 "push [edi]" \ 00888 "popf" \ 00889 "mul ebx" \ 00890 "pushf" \ 00891 "pop [edi]" \ 00892 "mov [esi],eax" \ 00893 "mov [ecx],edx" \ 00894 parm [edi] [esi] [ecx] [eax] [ebx] \ 00895 modify exact [esi edi eax ebx edx]; 00896 00897 void idiv_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s); 00898 #pragma aux idiv_byte_asm = \ 00899 "push [edi]" \ 00900 "popf" \ 00901 "idiv bl" \ 00902 "pushf" \ 00903 "pop [edi]" \ 00904 "mov [esi],al" \ 00905 "mov [ecx],ah" \ 00906 parm [edi] [esi] [ecx] [ax] [bl]\ 00907 modify exact [esi edi ax bl]; 00908 00909 void idiv_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s); 00910 #pragma aux idiv_word_asm = \ 00911 "push [edi]" \ 00912 "popf" \ 00913 "idiv bx" \ 00914 "pushf" \ 00915 "pop [edi]" \ 00916 "mov [esi],ax" \ 00917 "mov [ecx],dx" \ 00918 parm [edi] [esi] [ecx] [ax] [dx] [bx]\ 00919 modify exact [esi edi ax dx bx]; 00920 00921 void idiv_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s); 00922 #pragma aux idiv_long_asm = \ 00923 "push [edi]" \ 00924 "popf" \ 00925 "idiv ebx" \ 00926 "pushf" \ 00927 "pop [edi]" \ 00928 "mov [esi],eax" \ 00929 "mov [ecx],edx" \ 00930 parm [edi] [esi] [ecx] [eax] [edx] [ebx]\ 00931 modify exact [esi edi eax edx ebx]; 00932 00933 void div_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s); 00934 #pragma aux div_byte_asm = \ 00935 "push [edi]" \ 00936 "popf" \ 00937 "div bl" \ 00938 "pushf" \ 00939 "pop [edi]" \ 00940 "mov [esi],al" \ 00941 "mov [ecx],ah" \ 00942 parm [edi] [esi] [ecx] [ax] [bl]\ 00943 modify exact [esi edi ax bl]; 00944 00945 void div_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s); 00946 #pragma aux div_word_asm = \ 00947 "push [edi]" \ 00948 "popf" \ 00949 "div bx" \ 00950 "pushf" \ 00951 "pop [edi]" \ 00952 "mov [esi],ax" \ 00953 "mov [ecx],dx" \ 00954 parm [edi] [esi] [ecx] [ax] [dx] [bx]\ 00955 modify exact [esi edi ax dx bx]; 00956 00957 void div_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s); 00958 #pragma aux div_long_asm = \ 00959 "push [edi]" \ 00960 "popf" \ 00961 "div ebx" \ 00962 "pushf" \ 00963 "pop [edi]" \ 00964 "mov [esi],eax" \ 00965 "mov [ecx],edx" \ 00966 parm [edi] [esi] [ecx] [eax] [edx] [ebx]\ 00967 modify exact [esi edi eax edx ebx]; 00968 00969 #endif 00970 00971 #endif /* __X86EMU_PRIM_ASM_H */