home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / MKEY14.ASM < prev    next >
Assembly Source File  |  1994-10-15  |  1KB  |  52 lines

  1.     page    66,132
  2. ;******************************** MKEY14.ASM *********************************
  3.  
  4. LIBSEG           segment byte public "LIB"
  5.         assume cs:LIBSEG , ds:nothing
  6.  
  7. ;----------------------------------------------------------------------------
  8. .xlist
  9.     include  mac.inc
  10.     include  common.inc
  11. .list
  12. comment 
  13. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -(MOUSE/KEY)
  14. MOVE_MOUSE - sets the mouse's position
  15. ;
  16. ; inputs:  dh = text mode row#
  17. ;       dl = text mode column#
  18. ;       
  19. ; output:  none
  20. ;* * * * * * * * * * * * * *
  21. 
  22.     PUBLIC    MOVE_MOUSE
  23. MOVE_MOUSE    PROC    FAR
  24.    APUSH   AX,CX,DX
  25.    call    make_pixels
  26.    mov       ax,4
  27.    int       33h            ;set mouse cx=column dx=row
  28.    APOP    DX,CX,AX
  29.    RETF
  30. MOVE_MOUSE    ENDP
  31. ;---------------------------
  32. ; convert dx -- dl*8->cx  dh*8->dx
  33. ;
  34.     public    make_pixels
  35. make_pixels:
  36.    MOV       cx,dx        ;put column in -cx-
  37.    mov       ch,0            ;strip row
  38.    shl       cx,1            ;convert column
  39.    shl       cx,1            ;  to pixels
  40.    shl       cx,1            ;    (column * 8)
  41.  
  42.    xchg    dh,dl        ;move row# to -dl-
  43.    mov       dh,0            ;strip column info
  44.    shl       dx,1            ;convert row
  45.    shl       dx,1            ;  to pixels
  46.    shl       dx,1            ;    (column * 8)
  47.    ret
  48.  
  49.  
  50. LIBSEG    ENDS
  51.     end
  52.