sio.s revision 48907
148907Srnordier#
248907Srnordier# Copyright (c) 1999 Global Technology Associates, Inc.
348907Srnordier# All rights reserved.
448907Srnordier#
548907Srnordier# Redistribution and use in source and binary forms, with or without
648907Srnordier# modification, are permitted provided that the following conditions
748907Srnordier# are met:
848907Srnordier# 1. Redistributions of source code must retain the above copyright
948907Srnordier#    notice, this list of conditions and the following disclaimer.
1048907Srnordier# 2. Redistributions in binary form must reproduce the above copyright
1148907Srnordier#    notice, this list of conditions and the following disclaimer in the
1248907Srnordier#    documentation and/or other materials provided with the distribution.
1348907Srnordier#
1448907Srnordier# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND
1548907Srnordier# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1648907Srnordier# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1748907Srnordier# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
1848907Srnordier# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
1948907Srnordier# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
2048907Srnordier# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
2148907Srnordier# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2248907Srnordier# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
2348907Srnordier# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
2448907Srnordier# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2548907Srnordier#
2648907Srnordier#	From: sio.s 1.3 1999/01/10 14:48:03 rnordier
2748907Srnordier#	$Id:$
2848907Srnordier#
2948907Srnordier
3048907Srnordier		.set SIO_PRT,SIOPRT		# Base port
3148907Srnordier
3248907Srnordier		.globl sio_putchr
3348907Srnordier
3448907Srnordier# void sio_putchr(int c)
3548907Srnordier
3648907Srnordiersio_putchr:	movw $SIO_PRT+0x5,%dx		# Line status reg
3748907Srnordier		xor %ecx,%ecx			# Timeout
3848907Srnordier		movb $0x40,%ch			#  counter
3948907Srnordiersio_putchr.1:	inb (%dx),%al			# Transmitter
4048907Srnordier		testb $0x20,%al 		#  buffer empty?
4148907Srnordier		loopz sio_putchr.1		# No
4248907Srnordier		jz sio_putchr.2			# If timeout
4348907Srnordier		movb 0x4(%esp,1),%al		# Get character
4448907Srnordier		subb $0x5,%dl			# Transmitter hold reg
4548907Srnordier		outb %al,(%dx)			# Write character
4648907Srnordiersio_putchr.2:	ret				# To caller
47