DOCERR: _int86() and _int86x() Examples Missing from Help FileLast reviewed: July 17, 1997Article ID: Q97467  | 
	
| 
	
 
1.00 1.50 1.51
WINDOWS
kbprg kbdocerr
 The information in this article applies to: 
 
 SUMMARYThe Microsoft Visual C++ version 1.0 help file, MSCXX.HLP, does not contain the sample programs to demonstrate the _int86() and _int86x() functions. 
 MORE INFORMATIONWhen you view the _int86() or _int86x() topics in Microsoft Windows Help and choose the "Example" jump, Help displays the sample code for the _getcwd() function. The text below lists the missing sample programs. 
 Sample Code for _int86x()
 // INT86X.C: In this program, _int86x executes an Interrupt 21h to // invoke MS-DOS system call 43h (change file attributes). The program // uses _int86x because the file, which is referenced with a far // pointer, may be in a segment other than the default data segment. // For this reason the program must explicitly set the DS register // with the _SREGS structure. #include <signal.h> #include <dos.h> #include <stdio.h> #include <process.h> char __far *filename = "_int86x.c"; void main( void ){    union  _REGS inregs, outregs;
   struct _SREGS segregs;
   int    result;
   inregs.h.ah = 0x43;      // MS-DOS function to change attributes
   inregs.h.al = 0;         // Subfunction 0 to get attributes
   inregs.x.dx = _FP_OFF( filename );  // DS:DX points to filename
   segregs.ds  = _FP_SEG( filename );
   result = _int86x( 0x21, &inregs, &outregs, &segregs );
   if( outregs.x.cflag )
      printf( "Can't get file attributes; error no. %d\n", result);
   else
      printf( "Attribs = 0x%.4x\n", outregs.x.cx );
}
 Sample Code for _int86()
 // INT86.C: This program uses _int86 to call the BIOS video service // (Interrupt 10h) to get information about the cursor. #include <dos.h> #include <stdio.h> void main( void ){    union _REGS inregs, outregs;
   // Set up to get cursor information.
   inregs.h.ah = 3;       // Get cursor position function
   inregs.h.bh = 0;       // Page 0
   // Execute video interrupt.
   _int86( 0x10, &inregs, &outregs );
   // Display results.
   printf( "Cursor position\n\tRow: %d\n\tColumn: %d\n",
           outregs.h.dh, outregs.h.dl );
   printf( "Cursor shape\n\tStart: %d\n\tEnd: %d\n",
           outregs.h.ch, outregs.h.cl );
}
	
	 | 
	
	Additional reference words: 1.00 1.50 
 © 1998 Microsoft Corporation. All rights reserved. Terms of Use.  |