home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR2
/
DIGIPROG.ZIP
/
FCTFB.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-30
|
1KB
|
69 lines
#include <dos.h>
#include <stdio.h>
main()
{
struct REGPACK sregs;
int y,x,numbytes,dx,quit,xx,yy;
char byte;
union REGS regs;
/*struct SREGS sregs;*/
clrscr();
printf("\nEnter DX : ");
scanf("%d",&dx); while(kbhit()) getch();
regs.h.ah = 0xfb;
regs.h.al = 0;
printf("\nEnter Selection To Toggle ");
printf("\nA) DTR Line : "); xx=wherex(); yy=wherey();
printf("\nB) RTS Line : ");
printf("\nC) CTS TX Flow : ");
printf("\nD) DSR TX Flow : ");
printf("\nE) DCD TX Flow : ");
printf("\nQ)uit : ");
quit = byte = 0;
Toggle(byte,xx,yy);
while(!quit)
{
switch(toupper(getch()))
{
case 'A' : byte ^= 0x01; break;
case 'B' : byte ^= 0x02; break;
case 'C' : byte ^= 0x10; break;
case 'D' : byte ^= 0x20; break;
case 'E' : byte ^= 0x80; break;
case 'Q' : quit = 1; break;
}
Toggle(byte,xx,yy);
}
regs.h.al = byte;
regs.x.dx = dx;
printf("\nCall - AH : %02X AL : %02X",regs.h.ah, regs.h.al);
int86(0x14,®s,®s);
}
Toggle(unsigned char al,int xx, int yy)
{
int x,y;
char *Str[2] = {"OFF"," ON"};
x = wherex(); y=wherey();
gotoxy(xx,yy++); printf("%s",Str[al&0x1]);
gotoxy(xx,yy++); printf("%s",Str[(al&0x2)>>1]);
gotoxy(xx,yy++); printf("%s",Str[(al&0x10)>>4]);
gotoxy(xx,yy++); printf("%s",Str[(al&0x20)>>5]);
gotoxy(xx,yy++); printf("%s",Str[(al&0x80)>>7]);
gotoxy(x,y);
}