libhd  5.0
Macros | Functions | Variables
prim_ops.c File Reference
#include "x86emu/x86emui.h"

Macros

#define PRIM_OPS_NO_REDEFINE_ASM
#define PARITY(x)   (((x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
#define XOR2(x)   (((x) ^ ((x)>>1)) & 0x1)

Functions

u16 aaa_word (u16 d)
u16 aas_word (u16 d)
u16 aad_word (u16 d)
u16 aam_word (u8 d)
u8 adc_byte (u8 d, u8 s)
u16 adc_word (u16 d, u16 s)
u32 adc_long (u32 d, u32 s)
u8 add_byte (u8 d, u8 s)
u16 add_word (u16 d, u16 s)
u32 add_long (u32 d, u32 s)
u8 and_byte (u8 d, u8 s)
u16 and_word (u16 d, u16 s)
u32 and_long (u32 d, u32 s)
u8 cmp_byte (u8 d, u8 s)
u16 cmp_word (u16 d, u16 s)
u32 cmp_long (u32 d, u32 s)
u8 daa_byte (u8 d)
u8 das_byte (u8 d)
u8 dec_byte (u8 d)
u16 dec_word (u16 d)
u32 dec_long (u32 d)
u8 inc_byte (u8 d)
u16 inc_word (u16 d)
u32 inc_long (u32 d)
u8 or_byte (u8 d, u8 s)
u16 or_word (u16 d, u16 s)
u32 or_long (u32 d, u32 s)
u8 neg_byte (u8 s)
u16 neg_word (u16 s)
u32 neg_long (u32 s)
u8 not_byte (u8 s)
u16 not_word (u16 s)
u32 not_long (u32 s)
u8 rcl_byte (u8 d, u8 s)
u16 rcl_word (u16 d, u8 s)
u32 rcl_long (u32 d, u8 s)
u8 rcr_byte (u8 d, u8 s)
u16 rcr_word (u16 d, u8 s)
u32 rcr_long (u32 d, u8 s)
u8 rol_byte (u8 d, u8 s)
u16 rol_word (u16 d, u8 s)
u32 rol_long (u32 d, u8 s)
u8 ror_byte (u8 d, u8 s)
u16 ror_word (u16 d, u8 s)
u32 ror_long (u32 d, u8 s)
u8 shl_byte (u8 d, u8 s)
u16 shl_word (u16 d, u8 s)
u32 shl_long (u32 d, u8 s)
u8 shr_byte (u8 d, u8 s)
u16 shr_word (u16 d, u8 s)
u32 shr_long (u32 d, u8 s)
u8 sar_byte (u8 d, u8 s)
u16 sar_word (u16 d, u8 s)
u32 sar_long (u32 d, u8 s)
u16 shld_word (u16 d, u16 fill, u8 s)
u32 shld_long (u32 d, u32 fill, u8 s)
u16 shrd_word (u16 d, u16 fill, u8 s)
u32 shrd_long (u32 d, u32 fill, u8 s)
u8 sbb_byte (u8 d, u8 s)
u16 sbb_word (u16 d, u16 s)
u32 sbb_long (u32 d, u32 s)
u8 sub_byte (u8 d, u8 s)
u16 sub_word (u16 d, u16 s)
u32 sub_long (u32 d, u32 s)
void test_byte (u8 d, u8 s)
void test_word (u16 d, u16 s)
void test_long (u32 d, u32 s)
u8 xor_byte (u8 d, u8 s)
u16 xor_word (u16 d, u16 s)
u32 xor_long (u32 d, u32 s)
void imul_byte (u8 s)
void imul_word (u16 s)
void imul_long_direct (u32 *res_lo, u32 *res_hi, u32 d, u32 s)
void imul_long (u32 s)
void mul_byte (u8 s)
void mul_word (u16 s)
void mul_long (u32 s)
void idiv_byte (u8 s)
void idiv_word (u16 s)
void idiv_long (u32 s)
void div_byte (u8 s)
void div_word (u16 s)
void div_long (u32 s)
void ins (int size)
void outs (int size)
u16 mem_access_word (int addr)
void push_word (u16 w)
void push_long (u32 w)
u16 pop_word (void)
u32 pop_long (void)

Variables

static u32 x86emu_parity_tab [8]

Macro Definition Documentation

#define PARITY (   x)    (((x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
#define PRIM_OPS_NO_REDEFINE_ASM
#define XOR2 (   x)    (((x) ^ ((x)>>1)) & 0x1)

Function Documentation

u16 aaa_word ( u16  d)
u16 aad_word ( u16  d)

References CLEAR_FLAG, CONDITIONAL_SET_FLAG, F_AF, F_CF, F_OF, F_PF, F_SF, F_ZF, PARITY, u16, and u8.

Referenced by main(), and x86emuOp_aad().

u16 aam_word ( u8  d)

References CLEAR_FLAG, CONDITIONAL_SET_FLAG, F_AF, F_CF, F_OF, F_PF, F_SF, F_ZF, PARITY, and u16.

Referenced by main(), and x86emuOp_aam().

u16 aas_word ( u16  d)
u8 adc_byte ( u8  d,
u8  s 
)
u32 adc_long ( u32  d,
u32  s 
)
u16 adc_word ( u16  d,
u16  s 
)
u8 add_byte ( u8  d,
u8  s 
)
u32 add_long ( u32  d,
u32  s 
)
u16 add_word ( u16  d,
u16  s 
)
u8 and_byte ( u8  d,
u8  s 
)
u32 and_long ( u32  d,
u32  s 
)
u16 and_word ( u16  d,
u16  s 
)
u8 cmp_byte ( u8  d,
u8  s 
)
u32 cmp_long ( u32  d,
u32  s 
)
u16 cmp_word ( u16  d,
u16  s 
)
u8 daa_byte ( u8  d)
u8 das_byte ( u8  d)
u8 dec_byte ( u8  d)

References CONDITIONAL_SET_FLAG, F_AF, F_OF, F_PF, F_SF, F_ZF, PARITY, and XOR2.

Referenced by main(), and x86emuOp_opcFE_byte_RM().

u32 dec_long ( u32  d)
u16 dec_word ( u16  d)
void div_byte ( u8  s)

References M, u8, and x86emu_intr_raise().

Referenced by main(), and x86emuOp_opcF6_byte_RM().

void div_long ( u32  s)
void div_word ( u16  s)
void idiv_byte ( u8  s)

References M, and x86emu_intr_raise().

Referenced by main(), and x86emuOp_opcF6_byte_RM().

void idiv_long ( u32  s)
void idiv_word ( u16  s)
void imul_byte ( u8  s)

References CLEAR_FLAG, F_CF, F_OF, M, and SET_FLAG.

Referenced by main(), and x86emuOp_opcF6_byte_RM().

void imul_long ( u32  s)

References CLEAR_FLAG, F_CF, F_OF, imul_long_direct(), M, and SET_FLAG.

Referenced by main(), and x86emuOp_opcF7_word_RM().

void imul_long_direct ( u32 res_lo,
u32 res_hi,
u32  d,
u32  s 
)
void imul_word ( u16  s)

References CLEAR_FLAG, F_CF, F_OF, M, SET_FLAG, and u16.

Referenced by main(), and x86emuOp_opcF7_word_RM().

u8 inc_byte ( u8  d)

References CONDITIONAL_SET_FLAG, F_AF, F_OF, F_PF, F_SF, F_ZF, PARITY, and XOR2.

Referenced by main(), and x86emuOp_opcFE_byte_RM().

u32 inc_long ( u32  d)
u16 inc_word ( u16  d)
void ins ( int  size)
u16 mem_access_word ( int  addr)
void mul_byte ( u8  s)

References CLEAR_FLAG, F_CF, F_OF, M, SET_FLAG, and u16.

Referenced by main(), and x86emuOp_opcF6_byte_RM().

void mul_long ( u32  s)

References CLEAR_FLAG, F_CF, F_OF, M, SET_FLAG, u32, and u64.

Referenced by main(), and x86emuOp_opcF7_word_RM().

void mul_word ( u16  s)

References CLEAR_FLAG, F_CF, F_OF, M, SET_FLAG, and u16.

Referenced by main(), and x86emuOp_opcF7_word_RM().

u8 neg_byte ( u8  s)

References CONDITIONAL_SET_FLAG, F_AF, F_CF, F_OF, F_PF, F_SF, F_ZF, PARITY, u8, and XOR2.

Referenced by main(), and x86emuOp_opcF6_byte_RM().

u32 neg_long ( u32  s)

References CONDITIONAL_SET_FLAG, F_AF, F_CF, F_OF, F_PF, F_SF, F_ZF, PARITY, u32, and XOR2.

Referenced by main(), and x86emuOp_opcF7_word_RM().

u16 neg_word ( u16  s)

References CONDITIONAL_SET_FLAG, F_AF, F_CF, F_OF, F_PF, F_SF, F_ZF, PARITY, u16, and XOR2.

Referenced by main(), and x86emuOp_opcF7_word_RM().

u8 not_byte ( u8  s)

Referenced by main(), and x86emuOp_opcF6_byte_RM().

u32 not_long ( u32  s)

Referenced by main(), and x86emuOp_opcF7_word_RM().

u16 not_word ( u16  s)

Referenced by main(), and x86emuOp_opcF7_word_RM().

u8 or_byte ( u8  d,
u8  s 
)
u32 or_long ( u32  d,
u32  s 
)
u16 or_word ( u16  d,
u16  s 
)
void outs ( int  size)
u32 pop_long ( void  )
u16 pop_word ( void  )
void push_long ( u32  w)
void push_word ( u16  w)
u8 rcl_byte ( u8  d,
u8  s 
)

References ACCESS_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u32 rcl_long ( u32  d,
u8  s 
)

References ACCESS_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u16 rcl_word ( u16  d,
u8  s 
)

References ACCESS_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u8 rcr_byte ( u8  d,
u8  s 
)

References ACCESS_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u32 rcr_long ( u32  d,
u8  s 
)

References ACCESS_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u16 rcr_word ( u16  d,
u8  s 
)

References ACCESS_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u8 rol_byte ( u8  d,
u8  s 
)

References CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u32 rol_long ( u32  d,
u8  s 
)

References CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u16 rol_word ( u16  d,
u8  s 
)

References CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u8 ror_byte ( u8  d,
u8  s 
)

References CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u32 ror_long ( u32  d,
u8  s 
)

References CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u16 ror_word ( u16  d,
u8  s 
)

References CONDITIONAL_SET_FLAG, F_CF, F_OF, and XOR2.

Referenced by main().

u8 sar_byte ( u8  d,
u8  s 
)

References CLEAR_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_PF, F_SF, F_ZF, PARITY, and SET_FLAG.

Referenced by main().

u32 sar_long ( u32  d,
u8  s 
)

References CLEAR_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_PF, F_SF, F_ZF, PARITY, and SET_FLAG.

Referenced by main().

u16 sar_word ( u16  d,
u8  s 
)

References CLEAR_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_PF, F_SF, F_ZF, PARITY, and SET_FLAG.

Referenced by main().

u8 sbb_byte ( u8  d,
u8  s 
)
u32 sbb_long ( u32  d,
u32  s 
)
u16 sbb_word ( u16  d,
u16  s 
)
u8 shl_byte ( u8  d,
u8  s 
)
u32 shl_long ( u32  d,
u8  s 
)
u16 shl_word ( u16  d,
u8  s 
)
u32 shld_long ( u32  d,
u32  fill,
u8  s 
)
u16 shld_word ( u16  d,
u16  fill,
u8  s 
)
u8 shr_byte ( u8  d,
u8  s 
)

References CLEAR_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_OF, F_PF, F_SF, F_ZF, PARITY, SET_FLAG, u8, and XOR2.

Referenced by main().

u32 shr_long ( u32  d,
u8  s 
)

References CLEAR_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_OF, F_PF, F_SF, F_ZF, PARITY, SET_FLAG, and XOR2.

Referenced by main().

u16 shr_word ( u16  d,
u8  s 
)

References CLEAR_FLAG, CONDITIONAL_SET_FLAG, F_CF, F_OF, F_PF, F_SF, F_ZF, PARITY, SET_FLAG, and XOR2.

Referenced by main().

u32 shrd_long ( u32  d,
u32  fill,
u8  s 
)
u16 shrd_word ( u16  d,
u16  fill,
u8  s 
)
u8 sub_byte ( u8  d,
u8  s 
)
u32 sub_long ( u32  d,
u32  s 
)
u16 sub_word ( u16  d,
u16  s 
)
void test_byte ( u8  d,
u8  s 
)
void test_long ( u32  d,
u32  s 
)
void test_word ( u16  d,
u16  s 
)
u8 xor_byte ( u8  d,
u8  s 
)
u32 xor_long ( u32  d,
u32  s 
)
u16 xor_word ( u16  d,
u16  s 
)

Variable Documentation

u32 x86emu_parity_tab[8]
static
Initial value:
{
0x96696996,
0x69969669,
0x69969669,
0x96696996,
0x69969669,
0x96696996,
0x96696996,
0x69969669,
}