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

  1.  
  2. ;************************************************************************
  3. ; Enable text blink by setting Mode Register on EGA                     *
  4. ; Entry:        Flag - 0 => disable blinking                            *
  5. ;                      1 => enable blinking                             *
  6. ;************************************************************************
  7.  
  8. Flag    EQU     WORD PTR [BP+4]
  9.  
  10.         PUBLIC  _Text_Blink
  11.  
  12. _Text_Blink     PROC NEAR
  13.         PUSH    BP
  14.         MOV     BP,SP
  15.         CMP     Flag,0
  16.         JZ      Blink_Off
  17.         CALL    Enable_Blink
  18.         POP     BP
  19.         RET
  20. Blink_Off:
  21.         CALL    Disable_Blink
  22.         POP     BP
  23.         RET
  24. _Text_Blink     ENDP
  25.  
  26. Enable_Blink    PROC NEAR
  27.         PUSH    ES                      ;Preserve register
  28.         XOR     AX,AX                   ;Point to BIOS data area
  29.         MOV     ES,AX
  30.         TEST    BYTE PTR ES:[BIOS_Equipment],2   ;Is mono display attached?
  31.         JZ      Enable_Color            ;...No, go set color blink
  32. Enable_Mono:
  33.         MOV     DX,3BAH                 ;Get address of Attrib READ register
  34.         IN      AL,DX                   ;Reset data/index flip-flop
  35.         MOV     DX,3C0H                 ;Get address of Attribute controller
  36.         MOV     AL,30H                  ;Select MODE register
  37.         OUT     DX,AL
  38.         MOV     AL,0EH                  ;Enable blink for monochrome text
  39.         OUT     DX,AL
  40.         JMP     Enable_Done
  41. Enable_Color:
  42.         MOV     DX,3DAH                 ;Get address of Attrib READ register
  43.         IN      AL,DX                   ;Reset data/index flip-flop
  44.         MOV     DX,3C0H                 ;Select Mode register
  45.         MOV     AL,30H
  46.         OUT     DX,AL
  47.         MOV     AL,08H                  ;Enable blink for monochrome text
  48.         OUT     DX,AL
  49. Enable_Done:
  50.         POP     ES
  51.         RET
  52. Enable_Blink    ENDP
  53.  
  54. ;************************************************************************
  55. ; Disable text blink by setting Mode Register on EGA                    *
  56. ;************************************************************************
  57.  
  58. Disable_Blink   PROC NEAR
  59.         PUSH    ES                      ;Preserve register
  60.         XOR     AX,AX                   ;Point to BIOS data area
  61.         MOV     ES,AX
  62.         TEST    BYTE PTR ES:[BIOS_Equipment],2   ;Is mono display attached?
  63.         JZ      Disable_Color           ;...No, go set color blink
  64. Disable_Mono:
  65.         MOV     DX,3BAH                 ;Get address of Attrib READ register
  66.         IN      AL,DX                   ;Reset data/index flip-flop
  67.         MOV     DX,3C0H                 ;Get address of Attribute controller
  68.         MOV     AL,30H                  ;Select MODE register
  69.         OUT     DX,AL
  70.         MOV     AL,06H                  ;Enable blink for monochrome text
  71.         OUT     DX,AL
  72.         JMP     Disable_Done
  73. Disable_Color:
  74.         MOV     DX,3DAH                 ;Get address of Attrib READ register
  75.         IN      AL,DX                   ;Reset data/index flip-flop
  76.         MOV     DX,3C0H                 ;Select Mode register
  77.         MOV     AL,30H
  78.         OUT     DX,AL
  79.         MOV     AL,00H                  ;Enable blink for monochrome text
  80.         OUT     DX,AL
  81. Disable_Done:
  82.         POP     ES
  83.         RET
  84. Disable_Blink    ENDP
  85.