deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/****************************************************************************
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* Realmode X86 Emulator Library
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* Copyright (C) 1996-1999 SciTech Software, Inc.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* Copyright (C) David Mosberger-Tang
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* Copyright (C) 1999 Egbert Eich
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* ========================================================================
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* Permission to use, copy, modify, distribute, and sell this software and
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* its documentation for any purpose is hereby granted without fee,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* provided that the above copyright notice appear in all copies and that
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* both that copyright notice and this permission notice appear in
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* supporting documentation, and that the name of the authors not be used
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* in advertising or publicity pertaining to distribution of the software
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* without specific, written prior permission. The authors makes no
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* representations about the suitability of this software for any purpose.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* It is provided "as is" without express or implied warranty.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* PERFORMANCE OF THIS SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* ========================================================================
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* Language: ANSI C
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* Environment: Any
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* Developer: Kendall Bennett
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync* Description: Header file for primitive operation functions.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync****************************************************************************/
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifndef __X86EMU_PRIM_OPS_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define __X86EMU_PRIM_OPS_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifdef __cplusplus
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncextern "C" { /* Use "C" linkage when in C++ mode */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 aaa_word (u16 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 aas_word (u16 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 aad_word (u16 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 aam_word (u8 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 adc_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 adc_word (u16 d, u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 adc_long (u32 d, u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 add_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 add_word (u16 d, u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 add_long (u32 d, u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 and_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 and_word (u16 d, u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 and_long (u32 d, u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 cmp_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 cmp_word (u16 d, u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 cmp_long (u32 d, u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 daa_byte (u8 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 das_byte (u8 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 dec_byte (u8 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 dec_word (u16 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 dec_long (u32 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 inc_byte (u8 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 inc_word (u16 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 inc_long (u32 d);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 or_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 or_word (u16 d, u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 or_long (u32 d, u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 neg_byte (u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 neg_word (u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 neg_long (u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 not_byte (u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 not_word (u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 not_long (u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 rcl_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 rcl_word (u16 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 rcl_long (u32 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 rcr_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 rcr_word (u16 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 rcr_long (u32 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 rol_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 rol_word (u16 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 rol_long (u32 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 ror_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 ror_word (u16 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 ror_long (u32 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 shl_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 shl_word (u16 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 shl_long (u32 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 shr_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 shr_word (u16 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 shr_long (u32 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 sar_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 sar_word (u16 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 sar_long (u32 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 shld_word (u16 d, u16 fill, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 shld_long (u32 d, u32 fill, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 shrd_word (u16 d, u16 fill, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 shrd_long (u32 d, u32 fill, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 sbb_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 sbb_word (u16 d, u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 sbb_long (u32 d, u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 sub_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 sub_word (u16 d, u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 sub_long (u32 d, u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid test_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid test_word (u16 d, u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid test_long (u32 d, u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu8 xor_byte (u8 d, u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 xor_word (u16 d, u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 xor_long (u32 d, u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid imul_byte (u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid imul_word (u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid imul_long (u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid mul_byte (u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid mul_word (u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid mul_long (u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid idiv_byte (u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid idiv_word (u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid idiv_long (u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid div_byte (u8 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid div_word (u16 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid div_long (u32 s);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid ins (int size);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid outs (int size);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 mem_access_word (int addr);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid push_word (u16 w);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncvoid push_long (u32 w);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu16 pop_word (void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncu32 pop_long (void);
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifdef __cplusplus
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} /* End of "C" linkage for C++ */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* __X86EMU_PRIM_OPS_H */