syslinux-3.08-2 sources from FC4
[bootcd.git] / syslinux / writestr.inc
1 ;; $Id: writestr.inc,v 1.5 2005/01/18 13:13:50 hpa Exp $
2 ;; -----------------------------------------------------------------------
3 ;;   
4 ;;   Copyright 1994-2002 H. Peter Anvin - All Rights Reserved
5 ;;
6 ;;   This program is free software; you can redistribute it and/or modify
7 ;;   it under the terms of the GNU General Public License as published by
8 ;;   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 ;;   Boston MA 02111-1307, USA; either version 2 of the License, or
10 ;;   (at your option) any later version; incorporated herein by reference.
11 ;;
12 ;; -----------------------------------------------------------------------
13
14 ;;
15 ;; writestr.inc
16 ;;
17 ;; Code to write a simple string.
18 ;;
19
20                 section .text
21 ;
22 ; crlf: Print a newline
23 ;
24 crlf:           push ax
25                 mov al,CR
26                 call writechr
27                 mov al,LF
28                 call writechr
29                 pop ax
30                 ret
31
32 ;
33 ; cwritestr: write a null-terminated string to the console, saving
34 ;            registers on entry.
35 ;
36 ; Note: writestr and cwritestr are distinct in SYSLINUX (only)
37 ;
38 cwritestr:
39                 pushfd
40                 pushad
41 .top:           lodsb
42                 and al,al
43                 jz .end
44                 call writechr
45                 jmp short .top
46 .end:           popad
47                 popfd
48                 ret