1/*
2 * $XFree86: mit/server/ddx/x386/vga256/drivers/tvga8900/bank.s,v 2.0 1993/10/08 15:59:26 dawes Exp $
3 * Copyright 1992 by Alan Hourihane, Wigan, England.
4 *
5 * Permission to use, copy, modify, distribute, and sell this software and its
6 * documentation for any purpose is hereby granted without fee, provided that
7 * the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of Alan Hourihane not be used in
10 * advertising or publicity pertaining to distribution of the software without
11 * specific, written prior permission.  Alan Hourihane makes no representations
12 * about the suitability of this software for any purpose.  It is provided
13 * "as is" without express or implied warranty.
14 *
15 * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
17 * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
19 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21 * PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Author:  Alan Hourihane, alanh@logitek.co.uk, version 0.1beta
24 *
25 *	    David Wexelblat, dwex@goblin.org, version 0.2beta
26 *		(dual banks)
27 *	    David Wexelblat, version 0.3beta (back to 1 bank)
28 */
29
30
31/*
32 * These are here the very lowlevel VGA bankswitching routines.
33 * The segment to switch to is passed via %eax. Only %eax and %edx my be used
34 * without saving the original contents.
35 */
36
37#include "assyntax.h"
38
39	FILE("tvga8900bank.s")
40	AS_BEGIN
41
42	SEG_DATA
43
44	SEG_TEXT
45
46	ALIGNTEXT4
47	GLOBL GLNAME(TVGA8900SetReadWrite)
48	GLOBL GLNAME(TVGA8900SetRead)
49	GLOBL GLNAME(TVGA8900SetWrite)
50GLNAME(TVGA8900SetReadWrite):
51GLNAME(TVGA8900SetRead):
52GLNAME(TVGA8900SetWrite):
53	MOV_B	(AL,AH)
54	MOV_B	(CONST(0x0E),AL)
55	XOR_B	(CONST(0x02),AH)
56	MOV_L	(CONST(0x3C4),EDX)
57	OUT1_W	(DX)
58	RET
59