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