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