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