home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / R_LA4_01.ZIP / SETCUR.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-22  |  1.3 KB  |  35 lines

  1. /* SETCUR.C - From page 326 of "Microsoft C Programming for     */
  2. /* the IBM" by Robert Lafore. This program will set the cursor  */
  3. /* size from smaller than normal to a size filling the entire   */
  4. /* character block using ROM BIOS call 0x10 function 01. To     */
  5. /* use:  A>setcur xx yy where xx and yy are each numbers from   */
  6. /* 0 - 13. To get a normal cursor use: A>setcur 12 13           */
  7. /* By making the first number larger than the second you will   */
  8. /* get a two part cursor.                                       */
  9. /****************************************************************/
  10.  
  11. #include "dos.h"        /*declares REGS*/
  12. #define CURSIZE 1       /* "set cursor size service" of int 0x10*/
  13. #define VIDEO 0x10      /*video BIOS interrupt number*/
  14.  
  15. main(argc, argv)
  16. int argc;
  17. char *argv[];
  18. {
  19. union REGS regs;
  20. int start, end;
  21.  
  22.    if (argc != 3) {
  23.       printf("\nExample usage: A>setcur 12 13   (gives normal cursor)");
  24.       exit();
  25.    }
  26.    start = atoi(argv[1]);
  27.    end = atoi(argv[2]);
  28.    regs.h.ch = (char)start;      /*starting scan line number*/
  29.    regs.h.cl = (char)end;        /*ending scan line number*/
  30.    regs.h.ah = CURSIZE;          /*service number of int 0x10*/
  31.    int86(VIDEO, ®s, ®s);   /*call video interrupt*/
  32. }
  33.  
  34.  
  35.