FreeBSD/sys/contrib/x86emu/x86emu.c
static uint16_t *
decode_rh_seg_register(struct x86emu *emu)
{
	switch (emu->cur_rh) {
	case 0:
		return &emu->x86.R_ES;
	case 1:
		return &emu->x86.R_CS;
	case 2:
		return &emu->x86.R_SS;
	case 3:
		return &emu->x86.R_DS;
	case 4:
		return &emu->x86.R_FS;
	case 5:
		return &emu->x86.R_GS;
	default:
		x86emu_halt_sys(emu);
	}
}
/*
 * PARAMETERS:
 * reg	- Register to decode
 * 
 * RETURNS:
 * Pointer to the appropriate register
 * 
 * REMARKS:
 * Return a pointer to the register given by the R/RM field of the
 * modrm byte, for word operands, modified from above for the weirdo
 * special case of segreg operands.  Also enables the decoding of instructions.
 */
reg  - Register to decode

Pointer to the appropriate register

Return a pointer to the register given by the R/RM field of the
modrm byte, for word operands, modified from above for the weirdo
special case of segreg operands.  Also enables the decoding of instructions.
reg - Register to decode Pointer to the appropriate register Return a pointer to the register given by the R / RM field of the modrm byte for word operands modified from above for the weirdo special case of segreg operands . Also enables the decoding of instructions .
static uint16_t *
decode_rh_seg_register(struct x86emu *emu)
{
	switch (emu->cur_rh) {
	case 0:
		return &emu->x86.R_ES;
	case 1:
		return &emu->x86.R_CS;
	case 2:
		return &emu->x86.R_SS;
	case 3:
		return &emu->x86.R_DS;
	case 4:
		return &emu->x86.R_FS;
	case 5:
		return &emu->x86.R_GS;
	default:
		x86emu_halt_sys(emu);
	}
}
static uint16_t * decode_rh_seg_register ( struct x86emu * emu ) { switch ( emu -> cur_rh ) { case 0 : return & emu -> x86 . R_ES ; case 1 : return & emu -> x86 . R_CS ; case 2 : return & emu -> x86 . R_SS ; case 3 : return & emu -> x86 . R_DS ; case 4 : return & emu -> x86 . R_FS ; case 5 : return & emu -> x86 . R_GS ; default : x86emu_halt_sys ( emu ) ; } }
PARAMETERS:
 reg  - Register to decode
PARAMETERS : reg - Register to decode