home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGASM.ZIP / PROG045.ASM < prev    next >
Assembly Source File  |  1988-04-10  |  2KB  |  44 lines

  1.  
  2. ;************************************************************************
  3. ; Set cursor size by writing to CRTC registers                          *
  4. ; Entry:        Start - Starting line for cursor                        *
  5. ;               Stop  - Ending line for cursor                          *
  6. ;************************************************************************
  7.  
  8. Start   EQU     [BP+4]
  9. Stop    EQU     [BP+6]
  10.  
  11.         PUBLIC  _Set_Cursor_Size
  12.  
  13.  
  14. _Set_Cursor_Size PROC    NEAR
  15.         PUSH    BP
  16.         MOV     BP,SP
  17.         PUSH    ES                      ;Preserve ES
  18.         XOR     AX,AX                   ;Select segment zero
  19.         MOV     ES,AX
  20.  
  21.         MOV     AL,Start                ;Update BIOS data area vars.
  22.         MOV     ES:[BIOS_Curs_Start],AL ;To contain the new cursor shape
  23.         MOV     AL,Stop
  24.         MOV     ES:[BIOS_Curs_Stop],AL
  25.  
  26.         MOV     DX,ES:[BIOS_CRT_Addr]   ;Load CRTC address
  27.         MOV     AL,0AH                  ;Fetch index of cursor start
  28.         OUT     DX,AL                   ;Select index
  29.         INC     DX                      ;Load CRTC address
  30.         MOV     AL,Start                ;Fetch data value
  31.         OUT     DX,AL                   ;Write the cursor start
  32.  
  33.         DEC     DX                      ;Load CRTC address
  34.         MOV     AL,0BH                  ;Fetch index of cursor stop
  35.         OUT     DX,AL                   ;Select index
  36.         INC     DX                      ;Load CRTC address
  37.         MOV     AL,Stop                 ;Fetch data value
  38.         OUT     DX,AL                   ;Write cursor stop value
  39.  
  40.         POP     ES                              ;Restore ES
  41.         POP     BP
  42.         RET
  43. _Set_Cursor_Size ENDP
  44.