home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / QWIK13.ZIP / CURSOR.INC next >
Encoding:
Text File  |  1986-11-10  |  2.3 KB  |  48 lines

  1. { GotoRC - move cursor                                      ver 1.3, 11-10-86 }
  2. { This is the inverse of Turbo's GotoXY procedure and just as fast.           }
  3.  
  4. procedure GotoRC (Row, Col: Byte);
  5. begin
  6. Inline(
  7.   $B4/$02                {       MOV   AH,$02           ;Set AH = $02}
  8.   /$31/$DB               {       XOR   BX,BX            ;Set BX=0}
  9.   /$8E/$C3               {       MOV   ES,BX            ;Set ES=0}
  10.   /$26/$8A/$3E/$62/$04   {       ES:   MOV BH,[$0462]   ;Set BH=current page}
  11.   /$8A/$76/<ROW          {       MOV   DH,[BP+<Row]     ;Move Row}
  12.   /$FE/$CE               {       DEC   DH               ;Convert to 0-24 range}
  13.   /$8A/$56/<COL          {       MOV   DL,[BP+<Col]     ;Move Col}
  14.   /$FE/$CA               {       DEC   DL               ;Convert to 0-79 range}
  15.   /$CD/$10               {       INT   $10              ;Set cursor position}
  16. );
  17. end;
  18.  
  19.  
  20. { CursorChange - changes type or hides cursor, saves old    ver 1.3, 11-10-86 }
  21. { This utility will let you change the type (shape and visibility) of the
  22.   cursor.  At the same time, it saves the previous type.
  23.  
  24.   Shape:       Mono - top row = 0; bottom row = 13 (Default is 12,13)
  25.                CGA  - top row = 0; bottom row =  7 (Default is  6, 7)
  26.   Invisibilty: Set top row = 32 (bits 5-6 = 01)
  27.                 (Setting top > bottom also seems to work.)
  28.   Blinking:    Set top row + 96 (bits 5-6 = 11)
  29.                 (Supposedly this does a faster blink, but it doesn't
  30.                  work on all machines.)
  31.   Value:       >>>>>> SET New:= top shl 8 + bottom  <<<<<<
  32.  
  33.   Suggestions: For block cursor, set new:=  13   (Works on all machines.)
  34.                For invis cursor, set new:=8192                                }
  35.  
  36. procedure CursorChange (New: integer; VAR Old: integer);
  37. begin
  38. Inline(
  39.    $31/$C0               {       XOR   AX,AX            ;Set AX=0}
  40.   /$8E/$C0               {       MOV   ES,AX            ;Set ES=0}
  41.   /$26/$A1/$60/$04       {       ES: MOV AX,WO[$0460]   ;Read old cursor type}
  42.   /$C4/$7E/<OLD          {       LES   DI,[BP+<Old]     ;Set address for Old}
  43.   /$AB                   {       STOSW                  ;Store old value}
  44.   /$B4/$01               {       MOV   AH,$01           ;}
  45.   /$8B/$4E/<NEW          {       MOV   CX,[BP+<New]     ;Get New value}
  46.   /$CD/$10               {       INT   $10              ;Set cursor change}
  47. );
  48. end;