Borland C++ reference

geninterrupt

raw OCR

Generates a software interrupt.

Defined in header <dos.h>

Syntax

#include <dos.h>
void geninterrupt(int intr_num);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

The geninterrupt macro triggers a software trap for the interrupt given by intrjium. The state of all registers after the call depends on the interrupt called.

b^

Interrupts can leave registers used by C in unpredictable states.

Return value

None.

See also

Example

#include <conio.h>
#include <dos.h>
void writechar (char ch); /* function prototype  */

int main (void)

   clrscr 0;
   gotoxy(80,25);
   writechar ('*');
   getchO ;
   return 0;

/* outputs a character at the current cursor position  */
/* using the video BIOS to avoid scrolling of the  screen */
/* when writing to location  (80,25) */

void writechar (char ch) {
   struct text_info ti;
   gettextinfo(&;ti) ;   /* grab current text settings  */
   _AH = 9;              /* interrupt 0x10 sub-function  9 */
   _AL = ch;             /* character to be output  */
   _BH = 0;              /* video page */
   _BL = ti.attribute;   /* video attribute  */
   _CX = 1;              /* repetition factor  */
   geninterrupt (0x10);  /* output the char  */

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.