printf.s revision 1.1
1/*
2 * $NetBSD: printf.s,v 1.1 1996/11/29 23:36:29 is Exp $
3 *
4 *
5 * Copyright (c) 1996 Ignatios Souvatzis
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 *    notice, this list of conditions and the following disclaimer in the
15 *    documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 *    must display the following acknowledgement:
18 *      This product includes software developed by Ignatios Souvatzis
19 *      for the NetBSD project.
20 * 4. The name of the author may not be used to endorse or promote products
21 *    derived from this software without specific prior written permission
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
35
36/*
37 * printf calling exec's RawDoFmt
38 * Beware! You have to explicitly use %ld etc. for 32bit integers!
39 */
40	.text
41	.globl	_printf
42	.globl	_putchar, _SysBase
43
44Lputch:
45	movl	d0,sp@-
46	bsr	_putchar
47	addql	#4,sp
48	rts
49
50_printf:
51	movml	#0x0032,sp@-
52	lea	pc@(Lputch:w),a2
53	lea	sp@(20),a1
54	movl	sp@(16),a0
55	movl	pc@(_SysBase:w),a6
56	jsr	a6@(-0x20a)
57	movml	sp@+, #0x4c00
58	rts
59#if 0
60Lstorech:
61	movb	d0, a3@+
62	rts
63
64	.globl _sprintf
65_sprintf:
66	movml	#0x0032,sp@-
67	movl	sp@(16),a3
68	lea	pc@(Lstorech:w),a2
69	lea	sp@(24),a1
70	movl	sp@(20),a0
71	movl	pc@(_SysBase:w),a6
72	jsr	a6@(-0x20a)
73	movml	sp@+, #0x4c00
74	rts
75#endif
76