Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DisableCGA
 Map                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
;* DisableCga - Disables CGA video by reprogramming the control register.
;*
;* Shows:   Instructions - cli     sti
;*
;* Params:  None
;*
;* Return:  None
 
DisableCga PROC USES ax cx dx           ; Preserve registers
 
        mov     cx, -1                  ; Set maximum loop count
        mov     dx, 03DAh               ; Address of status register
 
        .REPEAT
        in      al, dx                  ; Get video status
        .UNTILCXZ !(al & 8)             ; Until retrace end/timeout
        cli                             ; Disallow interruptions
        mov     cx, -1                  ; Reset loop count
 
        .REPEAT
        in      al, dx                  ; Get video status
        .UNTILCXZ al & 8                ; Until retrace start/timeout
 
        sub     dx, 2                   ; DX = address of control reg
        mov     al, 1                   ; Value to disable CGA video
        out     dx, al                  ; Disable video
        sti                             ; Reenable interrupts
        ret
 
DisableCga ENDP
                                    -♦-