home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / code_examples / librar / scr_loc.c < prev    next >
Text File  |  1989-02-08  |  808b  |  38 lines

  1. /*--------------------------------------*/
  2. /*                    */
  3. /*              SCR_LOC(X,X)        */
  4. /*                    */
  5. /* Functionality:            */
  6. /*    Gets the current cursor        */
  7. /*    position.            */
  8. /* Arguments:                */
  9. /*    0: Horizontal coordinate    */
  10. /*    1: Vertical coordinate        */
  11. /* Returns: Nothing            */
  12. /* Functions used:            */
  13. /*    INT86()                */
  14. /* Author: John Callicotte        */
  15. /* Date created/modified: 09/01/88    */
  16. /*                    */
  17. /*--------------------------------------*/
  18.  
  19. # include "dos.h"
  20. void scr_loc(x,y)
  21. int *x,*y;
  22. {
  23.         int X,Y,d;
  24.     union REGS outt;
  25.         outt.x.ax=768;    /* AH register is 3. */
  26.  
  27.     outt.x.bx=0;    /* BX register is 0 */
  28.  
  29.         int86(16,&outt,&outt);    /* Make the BIOS screen call. */
  30.  
  31.     d=outt.x.dx;    /* DX has the coordinates. */
  32.  
  33.         X=d/256;
  34.         Y=d%256;
  35.     *x=X;
  36.     *y=Y;
  37. }
  38.