1 ;-----------------------------------------------------------
\r
3 ; MXLL.ASM - Load latches
\r
4 ; Copyright (c) 1993,1994 by Alessandro Scotti
\r
6 ;-----------------------------------------------------------
\r
10 PUBLIC mxLoadLatches
\r
12 MX_TEXT SEGMENT USE16 PARA PUBLIC 'CODE'
\r
13 ASSUME cs:MX_TEXT, ds:NOTHING, es:NOTHING
\r
15 EXTRN mx_VideoSegment : WORD
\r
17 ;-----------------------------------------------------------
\r
19 ; Loads the specified value into the VGA latches.
\r
22 ; BL = value to load into latches
\r
26 ; bit mask register to FFh;
\r
27 ; function select register to "move";
\r
28 ; write mode to 00h.
\r
30 ; this is for internal use only.
\r
32 mxLoadLatches PROC NEAR
\r
38 out dx, ax ; Set bit mask to FFh
\r
40 out dx, ax ; Set function to "move"
\r
42 out dx, ax ; Set write mode
\r
43 mov ax, [mx_VideoSegment]
\r
46 mov bh, 8 ; BH = write plane mask
\r
47 mov cx, 3 ; CX = count = read plane
\r
48 ; Saves old values and force BL into latches
\r
53 out dx, ax ; Select read plane
\r
57 out dx, ax ; Select write plane
\r
61 mov al, ds:[di] ; Force value into latch
\r
62 shr bh, 1 ; Next write plane
\r
64 ; Restore previous values
\r
71 out dx, ax ; Select write plane
\r
74 shr bh, 1 ; Next write plane
\r