Be excrutiatingly correct with inline assembly syntax
[syslinux.git] / writestr.inc
blobe4d63cafc296a85c1dac981e2de622c4b0840787
1 ;; $Id$
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.
12 ;; -----------------------------------------------------------------------
15 ;; writestr.inc
17 ;; Code to write a simple string.
20                 section .text
22 ; crlf: Print a newline
24 crlf:           push ax
25                 mov al,CR
26                 call writechr
27                 mov al,LF
28                 call writechr
29                 pop ax
30                 ret
33 ; cwritestr: write a null-terminated string to the console, saving
34 ;            registers on entry.
36 ; Note: writestr and cwritestr are distinct in SYSLINUX (only)
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