65fea56f17cd614bc8908264df980a62e1931468vboxsync/****************************************************************************
65fea56f17cd614bc8908264df980a62e1931468vboxsync*
65fea56f17cd614bc8908264df980a62e1931468vboxsync* Realmode X86 Emulator Library
65fea56f17cd614bc8908264df980a62e1931468vboxsync*
65fea56f17cd614bc8908264df980a62e1931468vboxsync* Copyright (C) 1996-1999 SciTech Software, Inc.
65fea56f17cd614bc8908264df980a62e1931468vboxsync* Copyright (C) David Mosberger-Tang
65fea56f17cd614bc8908264df980a62e1931468vboxsync* Copyright (C) 1999 Egbert Eich
65fea56f17cd614bc8908264df980a62e1931468vboxsync*
65fea56f17cd614bc8908264df980a62e1931468vboxsync* ========================================================================
65fea56f17cd614bc8908264df980a62e1931468vboxsync*
65fea56f17cd614bc8908264df980a62e1931468vboxsync* Permission to use, copy, modify, distribute, and sell this software and
65fea56f17cd614bc8908264df980a62e1931468vboxsync* its documentation for any purpose is hereby granted without fee,
65fea56f17cd614bc8908264df980a62e1931468vboxsync* provided that the above copyright notice appear in all copies and that
65fea56f17cd614bc8908264df980a62e1931468vboxsync* both that copyright notice and this permission notice appear in
65fea56f17cd614bc8908264df980a62e1931468vboxsync* supporting documentation, and that the name of the authors not be used
65fea56f17cd614bc8908264df980a62e1931468vboxsync* in advertising or publicity pertaining to distribution of the software
65fea56f17cd614bc8908264df980a62e1931468vboxsync* without specific, written prior permission. The authors makes no
65fea56f17cd614bc8908264df980a62e1931468vboxsync* representations about the suitability of this software for any purpose.
65fea56f17cd614bc8908264df980a62e1931468vboxsync* It is provided "as is" without express or implied warranty.
65fea56f17cd614bc8908264df980a62e1931468vboxsync*
65fea56f17cd614bc8908264df980a62e1931468vboxsync* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
65fea56f17cd614bc8908264df980a62e1931468vboxsync* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
65fea56f17cd614bc8908264df980a62e1931468vboxsync* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
65fea56f17cd614bc8908264df980a62e1931468vboxsync* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
65fea56f17cd614bc8908264df980a62e1931468vboxsync* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
65fea56f17cd614bc8908264df980a62e1931468vboxsync* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
65fea56f17cd614bc8908264df980a62e1931468vboxsync* PERFORMANCE OF THIS SOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync*
65fea56f17cd614bc8908264df980a62e1931468vboxsync* ========================================================================
65fea56f17cd614bc8908264df980a62e1931468vboxsync*
65fea56f17cd614bc8908264df980a62e1931468vboxsync* Language: ANSI C
65fea56f17cd614bc8908264df980a62e1931468vboxsync* Environment: Any
65fea56f17cd614bc8908264df980a62e1931468vboxsync* Developer: Kendall Bennett
65fea56f17cd614bc8908264df980a62e1931468vboxsync*
65fea56f17cd614bc8908264df980a62e1931468vboxsync* Description: Header file for instruction decoding logic.
65fea56f17cd614bc8908264df980a62e1931468vboxsync*
65fea56f17cd614bc8908264df980a62e1931468vboxsync****************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef __X86EMU_DECODE_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define __X86EMU_DECODE_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*---------------------- Macros and type definitions ----------------------*/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Instruction Decoding Stuff */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define FETCH_DECODE_MODRM(mod,rh,rl) fetch_decode_modrm(&mod,&rh,&rl)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DECODE_RM_BYTE_REGISTER(r) decode_rm_byte_register(r)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DECODE_RM_WORD_REGISTER(r) decode_rm_word_register(r)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DECODE_RM_LONG_REGISTER(r) decode_rm_long_register(r)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DECODE_CLEAR_SEGOVR() M.x86.mode &= ~SYSMODE_CLRMASK
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*-------------------------- Function Prototypes --------------------------*/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __cplusplus
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern "C" { /* Use "C" linkage when in C++ mode */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync void x86emu_intr_raise(u8 type);
65fea56f17cd614bc8908264df980a62e1931468vboxsync void fetch_decode_modrm(int *mod, int *regh, int *regl);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u8 fetch_byte_imm(void);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u16 fetch_word_imm(void);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u32 fetch_long_imm(void);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u8 fetch_data_byte(uint offset);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u8 fetch_data_byte_abs(uint segment, uint offset);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u16 fetch_data_word(uint offset);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u16 fetch_data_word_abs(uint segment, uint offset);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u32 fetch_data_long(uint offset);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u32 fetch_data_long_abs(uint segment, uint offset);
65fea56f17cd614bc8908264df980a62e1931468vboxsync void store_data_byte(uint offset, u8 val);
65fea56f17cd614bc8908264df980a62e1931468vboxsync void store_data_byte_abs(uint segment, uint offset, u8 val);
65fea56f17cd614bc8908264df980a62e1931468vboxsync void store_data_word(uint offset, u16 val);
65fea56f17cd614bc8908264df980a62e1931468vboxsync void store_data_word_abs(uint segment, uint offset, u16 val);
65fea56f17cd614bc8908264df980a62e1931468vboxsync void store_data_long(uint offset, u32 val);
65fea56f17cd614bc8908264df980a62e1931468vboxsync void store_data_long_abs(uint segment, uint offset, u32 val);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u8 *decode_rm_byte_register(int reg);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u16 *decode_rm_word_register(int reg);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u32 *decode_rm_long_register(int reg);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u16 *decode_rm_seg_register(int reg);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u32 decode_rm00_address(int rm);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u32 decode_rm01_address(int rm);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u32 decode_rm10_address(int rm);
65fea56f17cd614bc8908264df980a62e1931468vboxsync u32 decode_sib_address(int sib, int mod);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __cplusplus
65fea56f17cd614bc8908264df980a62e1931468vboxsync} /* End of "C" linkage for C++ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* __X86EMU_DECODE_H */