Ejemplo n.º 1
0
main()
{
fhandle = open("options.exe", O_RDWR | O_BINARY,
                              S_IREAD | S_IWRITE);
lseek(fhandle,1,SEEK_SET);
do
{
lastseek = read(fhandle,&buffer,BUFLEN);
string1 = find(_osmajor * _osminor - ALPHA + 'C'
               + biosequip()*biosmemory() - DELTA,buffer,&buffer[BUFLEN],checkdisktype()- GAMMA + 5);
string1 = find(_osminor / _osmajor - BETA + 'A'
+ biosequip()*biosmemory() - DELTA,buffer,&buffer[BUFLEN],checkdisktype()- GAMMA + 5);
lseek(fhandle,-lastseek,SEEK_CUR);
write(fhandle,&buffer,BUFLEN + biosequip()*biosmemory() - DELTA);
} while (string1 == NULL && !eof(fhandle));
close(fhandle);
}
Ejemplo n.º 2
0
/*************************************************************************
 *
 *N  coprocessor_present
 *
 *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 *
 *   Purpose:
 *P
 *     This function determines whether a math coprocessor chip is present
 *     on the current computer configuration.
 *E
 *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 *
 *   Parameters:
 *A
 *    return <output> == (int) TRUE if present, FALSE if not.
 *E
 *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 *
 *   History:
 *H
 *    Barry Michaels   July 1991                          DOS Turbo C
 *E
 *************************************************************************/
int coprocessor_present( void )
{
   int stat;

   stat = biosequip();

   /* If bit 1 of stat is on, a coprocessor is present */
   if (stat & 2)
      return TRUE;
   else
      return FALSE;
}
Ejemplo n.º 3
0
int main(void)
{
unsigned result;

clrscr();
result = biosequip();
if(result & 0x0002)
printf("Math co-processor installed\n");
else
printf("Math co-processor is not installed.\n");

return 0;

}
Ejemplo n.º 4
0
void oGetScreenDimensions(void)
{	int mode;
	USEREGS

	/* if the current output device is a device & stdout -->
		use the BIOS video to acquire the screen dimensions from */
	if(oConsole()) {
		_AH = 0xf;				/* Get active mode & page */
		geninterrupt(0x10);
		mode = _AL;
		oPage = _BH;			/* destroys AX */
		switch(mode) {
		case 0: case 1: case 4: case 5:
			oColMax = 40;
			oRowMax = 25;
			break;
		case 2: case 3: case 6: case 7:
			oColMax = 80;
			oRowMax = 25;
			break;
		default:
			oRowMax = oColMax = 0;
			break;
		}
		if((biosequip() & 0x30) == 0) {
			/* Assume VGA card */
			oRowMax = oColMax = 0;
		}
		if(!oRowMax)
			oRowMax = peekw(0x40, 0x84) + 1;
		if(!oColMax)
			oColMax = peekw(0x40, 0x4a);
	} else {			/* file output */
		oRowMax = 0;	/* unlimited */
		oColMax = 80;
		oPage = -1;
	}
	dprintf(("[OUT: page: %d, columns: %d, rows: %d]\n"
	 , oPage, oColMax, oRowMax));
}