home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / nan12.zip / CRSONOF.ASM next >
Assembly Source File  |  1986-11-04  |  2KB  |  98 lines

  1.     TITLE CRSONOFF
  2.     PAGE ,132
  3.  
  4. ;    Title:    CRSONOF.ASM
  5. ;    Date:    sometime 1985
  6. ;    Syntax:    do CURSON
  7. ;            do CURSOFF
  8. ;    Note:    turns cursor ON and OFF
  9. ;
  10. ;    Revised PBaenziger, pbprograms, 1215 Lane, Kalamzoo, MI 49001
  11. ;    (616) 349-9720 (Evenings), 323-7392 (Days, 8-4:30 EDT)
  12. ;    
  13. ;    Works for all monitors, simplified
  14. ;
  15. public    CURSON            ; set cursor ON        
  16. public    CURSOFF            ; set cursor OFF       
  17. ;
  18. ;
  19. extrn    _RET:far            ; Clipper return Null
  20. ;==================================================
  21. DGROUP    GROUP    DATASG
  22. datasg segment PUBLIC  'DATA'
  23. ;==================================================
  24.  
  25. CURS_OFF_VAL    DW  0F00H        ; Seems to work under all conditions
  26. CURR_CURS_ON    DW  0        ; Current cursor on value
  27. MONO_CURS_ON    DW  0B0CH        ;0C0DH - alternate value
  28. CG_CURS_ON    DW  0607H
  29.  
  30. ;==================================================
  31. datasg ends
  32. ;==================================================
  33.  
  34. ;
  35. ;
  36. ;==================================================
  37. _prog  segment byte        ; byte aligned         
  38. assume cs:_prog, DS:DGROUP                    
  39. ;==================================================
  40. ;
  41.  
  42. CURSON    proc    far            ; far process
  43.         
  44.         push    bp            ; Not really needed, routine doesn't
  45.                         ; change BP. However, just in case of
  46.                         ; a bad clone BIOS
  47.  
  48.         ; Works with MDA, CGA and EGA and clones in text modes
  49.         ;!!!! Not for GRAPHIC modes !!!!!
  50.  
  51.             CMP [CURR_CURS_ON],0    ; Check if this is the first time
  52.         JNE TURN_ON            ; Jump if not, we know what board
  53.                             ; we're running under
  54.  
  55.         ;First time called, find out the video state
  56.         MOV CX, [MONO_CURS_ON]    ; Assume it's going to be MDA
  57.         MOV AH, 0FH            ; Find out video status
  58.         INT 10H
  59.         CMP AL, 7                ; 7 = MDA, all others assumed CGA/EGA
  60.         JE STORE_IT             ; Jump if MDA
  61.         MOV CX, [CG_CURS_ON]    ; No, it's CGA/EGA - replace values
  62.  
  63. STORE_IT:    MOV [CURR_CURS_ON], CX    ; And save the value for future use
  64.         
  65. TURN_ON:    MOV CX, [CURR_CURS_ON]
  66.         MOV AH, 1
  67.         INT 10H
  68.  
  69.         pop    bp            ; restore base pointer
  70.  
  71.         call    _RET            ; call Clipper return for nothing
  72.         
  73.         ret                ; far return
  74.  
  75. CURSON    endp                ; end of process
  76. ;
  77. ;
  78. CURSOFF    proc    far            ; far process
  79.  
  80.         push    bp            ; save return address
  81.  
  82.             MOV CX, [CURS_OFF_VAL]
  83.         MOV AH, 1
  84.         INT 10H
  85.  
  86.         pop    bp            ; restore base pointer
  87.     
  88.         call    _RET            ; call Clipper return for nothing
  89.  
  90.         ret                ; far return
  91.  
  92. CURSOFF    endp                ; end of process
  93. ;
  94. _prog    ends                ; end of segment
  95.         end                ; end of programme
  96. ;
  97. ;
  98.