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