home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <dos.h>
-
- #define dos_function 0x37
- #define read_switch_character 0
- #define write_switch_character 1
-
- main(int argc,char *argv[])
- {
- union REGS in_regs,out_regs;
-
- in_regs.h.ah = dos_function;
- if (argc == 2)
- {
- in_regs.h.al = write_switch_character;
- in_regs.h.dl = *argv[1];
- }
- else
- in_regs.h.al = read_switch_character;
- intdos(&in_regs,&out_regs);
- fputs("switch character: ",stderr);
- fputc(out_regs.h.dl,stderr);
- fputc('\n',stderr);
- }
-