FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Implements the DIV instruction and side effects.
 */
Implements the DIV instruction and side effects.
Implements the DIV instruction and side effects .
static void 
div_byte(struct x86emu *emu, uint8_t s)
{
	uint32_t dvd, div, mod;
	dvd = emu->x86.R_AX;
	if (s == 0) {
		x86emu_intr_raise(emu, 8);
		return;
	}
	div = dvd / (uint8_t) s;
	mod = dvd % (uint8_t) s;
	if (div > 0xff) {
		x86emu_intr_raise(emu, 8);
		return;
	}
	emu->x86.R_AL = (uint8_t) div;
	emu->x86.R_AH = (uint8_t) mod;
}
static void div_byte ( struct x86emu * emu , uint8_t s ) { uint32_t dvd , div , mod ; dvd = emu -> x86 . R_AX ; if ( s == 0 ) { x86emu_intr_raise ( emu , 8 ) ; return ; } div = dvd / ( uint8_t ) s ; mod = dvd % ( uint8_t ) s ; if ( div > 0xff ) { x86emu_intr_raise ( emu , 8 ) ; return ; } emu -> x86 . R_AL = ( uint8_t ) div ; emu -> x86 . R_AH = ( uint8_t ) mod ; }
REMARKS:
 Implements the DIV instruction and side effects.
REMARKS : Implements the DIV instruction and side effects .