!************************************************************************** !* !* Network driver interface for netboot bootrom !* !* Module: print.S !* Purpose: Console output routines required by the network drivers !* Entries: prnstr, prnchar, prnbyte, prnword !* !************************************************************************** !* !* Copyright (C) 1998-2003 Gero Kuhlmann !* !* This program is free software; you can redistribute it and/or modify !* it under the terms of the GNU General Public License as published by !* the Free Software Foundation; either version 2 of the License, or !* any later version. !* !* This program is distributed in the hope that it will be useful, !* but WITHOUT ANY WARRANTY; without even the implied warranty of !* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the !* GNU General Public License for more details. !* !* You should have received a copy of the GNU General Public License !* along with this program; if not, write to the Free Software !* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. !* !* $Id: print.S,v 1.4 2003/01/25 23:29:41 gkminix Exp $ !* ! !************************************************************************** ! ! Load assembler macros and other include files. ! #include ! !************************************************************************** ! ! Start code segment. ! .text public prnstr public prnword public prnbyte public prnchar ! !************************************************************************** ! ! Print a string onto the console screen. ! Input: CS:BX - pointer to zero terminated string ! Output: none ! Registers changed: AX, BX ! prnstr: prnst1: seg cs mov al,[bx] or al,al ! end of string jz prnst2 call prnchar ! print character inc bx ! proceed with next character jmp prnst1 prnst2: ret ! !************************************************************************** ! ! Print a word/byte/nibble onto the console screen ! Input: AX - value ! Output: none ! Registers changed: AX ! prnword: push ax mov al,ah call prnbyte ! print high word pop ax ! print low word prnbyte: push ax #ifdef IS186 shr al,#4 #else shr al,#1 shr al,#1 ! print high nibble shr al,#1 shr al,#1 #endif call prnnibble pop ax ! print low nibble prnnibble: and al,#$0F add al,#$30 ! convert into ASCII character cmp al,#$39 jbe prnchar add al,#7 ! fall through to character printing ! routine ! !************************************************************************** ! ! Print a character onto the console screen ! Input: AL - character ! Output: none ! Registers changed: AX ! prnchar: push bx mov ah,#$0E ! dont use int 29h here, because this xor bh,bh ! routine might be called before int $29 int INT_VIDEO ! has been setup. use the BIOS directly. pop bx ret ! !************************************************************************** ! end