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 instruction decoding logic.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync****************************************************************************/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifndef __X86EMU_DECODE_H
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define __X86EMU_DECODE_H
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*---------------------- Macros and type definitions ----------------------*/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* Instruction Decoding Stuff */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define FETCH_DECODE_MODRM(mod,rh,rl) fetch_decode_modrm(&mod,&rh,&rl)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define DECODE_RM_BYTE_REGISTER(r) decode_rm_byte_register(r)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define DECODE_RM_WORD_REGISTER(r) decode_rm_word_register(r)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define DECODE_RM_LONG_REGISTER(r) decode_rm_long_register(r)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define DECODE_CLEAR_SEGOVR() M.x86.mode &= ~SYSMODE_CLRMASK
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*-------------------------- Function Prototypes --------------------------*/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifdef __cplusplus
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern "C" { /* Use "C" linkage when in C++ mode */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncvoid x86emu_intr_raise (u8 type);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncvoid fetch_decode_modrm (int *mod,int *regh,int *regl);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu8 fetch_byte_imm (void);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu16 fetch_word_imm (void);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu32 fetch_long_imm (void);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu8 fetch_data_byte (uint offset);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu8 fetch_data_byte_abs (uint segment, uint offset);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu16 fetch_data_word (uint offset);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu16 fetch_data_word_abs (uint segment, uint offset);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu32 fetch_data_long (uint offset);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu32 fetch_data_long_abs (uint segment, uint offset);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncvoid store_data_byte (uint offset, u8 val);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncvoid store_data_byte_abs (uint segment, uint offset, u8 val);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncvoid store_data_word (uint offset, u16 val);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncvoid store_data_word_abs (uint segment, uint offset, u16 val);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncvoid store_data_long (uint offset, u32 val);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncvoid store_data_long_abs (uint segment, uint offset, u32 val);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu8* decode_rm_byte_register(int reg);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu16* decode_rm_word_register(int reg);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu32* decode_rm_long_register(int reg);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu16* decode_rm_seg_register(int reg);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu32 decode_rm00_address(int rm);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu32 decode_rm01_address(int rm);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu32 decode_rm10_address(int rm);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncu32 decode_sib_address(int sib, int mod);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifdef __cplusplus
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} /* End of "C" linkage for C++ */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif /* __X86EMU_DECODE_H */