summaryrefslogtreecommitdiff
path: root/reference/C/CONTRIB/SNIP/break.c
blob: 6334255e91a0e7209d16d4fbb548e4887c2fc1fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
**  Set or determine the status of the DOS "SET BREAK=" command
*/

#include <dos.h>

#define BOOL(x) (!(!(x)))

/*
**  Returns status of DOS "SET BREAK" command
*/

int isBreakOn(void)
{
      union REGS regs;

      regs.x.ax = 0x3300;
      intdos(&regs, &regs);
      return (int)regs.h.dl;
}

void setBreak(int OnOff)      /* Off = 0, On = 1      */
{
      union REGS regs;

      regs.x.ax = 0x3301;
      regs.h.dl = OnOff;
      intdos(&regs, &regs);
}