#ifndef _ARM2X86_SELF_H_
#define _ARM2X86_SELF_H_

#define AREG_st		"ebp"
#define AREG_T0		"ebx"
#define AREG_T1		"esi"
#define AREG_T2		"edi"
register ARMul_State *st	asm(AREG_st);
//register struct ARMul_State *st	asm(AREG_st);
register uint32_t T0		asm(AREG_T0);
register uint32_t T1		asm(AREG_T1);
register uint32_t T2		asm(AREG_T2);

#define EQ 0
#define NE 1
#define CS 2
#define CC 3
#define MI 4
#define PL 5
#define VS 6
#define VC 7
#define HI 8
#define LS 9
#define GE 10
#define LT 11
#define GT 12
#define LE 13
#define AL 14
#define NV 15

#ifndef NFLAG
#define NFLAG	state->NFlag
#endif	//NFLAG

#ifndef ZFLAG
#define ZFLAG	state->ZFlag
#endif	//ZFLAG

#ifndef CFLAG
#define CFLAG	state->CFlag
#endif	//CFLAG

#ifndef VFLAG
#define VFLAG	state->VFlag
#endif	//VFLAG

#ifndef IFLAG
#define IFLAG	(state->IFFlags >> 1)
#endif	//IFLAG

#ifndef FFLAG
#define FFLAG	(state->IFFlags & 1)
#endif	//FFLAG

#ifndef IFFLAGS
#define IFFLAGS	state->IFFlags
#endif	//VFLAG

#define NFLAG_reg	st->NFlag
#define ZFLAG_reg	st->ZFlag
#define CFLAG_reg	st->CFlag
#define VFLAG_reg	st->VFlag

#define NBIT_SHIFT	31
#define ZBIT_SHIFT	30
#define CBIT_SHIFT	29
#define VBIT_SHIFT	28

#endif	//_ARM2X86_SELF_H_
