Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!eos!labrea!decwrl!hplabs!hp-pcd!hpcvlx!eric From: eric@hpcvlx.HP.COM (Eric Gullerud) Newsgroups: comp.sys.ibm.pc Subject: Re: Stop cursor blinking in MS-DOS Message-ID: <1180017@hpcvlx.HP.COM> Date: 4 May 88 21:15:26 GMT References: <22066@teknowledge-vaxc.ARPA> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 63 Here is a program that will turn the cursor on or off. It uses the BIOS Video call (INT 10H). This program is actually a modified version of an example program in the MSC 5.1 Reference Manual for the "int86" library routine (on page 366). The actual code to alter the cursor is only 4 lines. Hope this helps... Eric Gullerud eric@hpcvlx.HP.COM ------------------------------ cut here --------------------------------- /* * blinker.c -- turn the cursor on or off */ #define VIDEO_IO 0x10 #define SET_CRSR 1 #include #include union REGS regs; /* top and bottom values for cursors on various & sundry displays: */ #define MONO_TOP 12 #define MONO_BOT 13 #define COLOR_TOP 6 #define COLOR_BOT 7 #define EGA43_TOP 4 #define EGA43_BOT 5 main(int argc, char **argv) { int top, bottom, mode; /* check for correct command usage */ if (argc != 2) { printf("Usage: %s \n", argv[0]); exit(1); } /* set top and bottom for cursor; could be on command line too */ top = COLOR_TOP; /* I have an EGA card; this is the mode */ bottom = COLOR_BOT; /* ... that it boots up in */ /* get cursor mode from command argument */ if (!strcmp(argv[1], "on")) mode = 0; /* default for EGA */ else if (!strcmp(argv[1], "off")) mode = 1; else if (!strcmp(argv[1], "slow")) mode = 2; else if (!strcmp(argv[1], "fast")) mode = 3; else { printf("%s: illegal cursor mode (%s)\n", argv[0], argv[1]); exit(1); } /* Set up for cursor change call */ regs.h.ah = SET_CRSR; regs.h.ch = top + (mode << 4); regs.h.cl = bottom; /* Execute BIOS interrupt call */ int86(VIDEO_IO, ®s, ®s); }