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