DOCERR: _int86() and _int86x() Examples Missing from Help File

Last reviewed: July 17, 1997
Article ID: Q97467
1.00 1.50 1.51 WINDOWS kbprg kbdocerr

The information in this article applies to:

  • The C Run-time (CRT), included with: Microsoft Visual C++ for Windows, versions 1.0, 1.5, and 1.51

SUMMARY

The Microsoft Visual C++ version 1.0 help file, MSCXX.HLP, does not contain the sample programs to demonstrate the _int86() and _int86x() functions.

MORE INFORMATION

When 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
KBCategory: kbprg kbdocerr
KBSubcategory: CRTIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.