From 2c91ec128b7511f2dcbcf47eff8f956a64da1a3e Mon Sep 17 00:00:00 2001 From: is Date: Tue, 24 Jan 2006 19:56:27 +0000 Subject: [PATCH] Implement sprintf and snprintf. --- sys/arch/amiga/stand/bootblock/boot/printf.s | 21 ++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sys/arch/amiga/stand/bootblock/boot/printf.s b/sys/arch/amiga/stand/bootblock/boot/printf.s index 68e118b33d8a..384795749f0a 100644 --- a/sys/arch/amiga/stand/bootblock/boot/printf.s +++ b/sys/arch/amiga/stand/bootblock/boot/printf.s @@ -1,7 +1,7 @@ -/* $NetBSD: printf.s,v 1.6 2001/03/02 16:43:26 mhitch Exp $ */ +/* $NetBSD: printf.s,v 1.7 2006/01/24 19:56:27 is Exp $ */ /*- - * Copyright (c) 1996 The NetBSD Foundation, Inc. + * Copyright (c) 1996,2006 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -58,7 +58,7 @@ ENTRY_NOPROFILE(printf) jsr %a6@(-0x20a) movml %sp@+, #0x4c00 rts -#if 0 + Lstorech: movb %d0, %a3@+ rts @@ -73,4 +73,17 @@ ENTRY_NOPROFILE(sprintf) jsr %a6@(-0x20a) movml %sp@+, #0x4c00 rts -#endif + +/* + * XXX cheating - at least for now. + */ +ENTRY_NOPROFILE(snprintf) + movml #0x0032,%sp@- + movl %sp@(16),%a3 + lea %pc@(Lstorech:w),%a2 + lea %sp@(28),%a1 + movl %sp@(24),%a0 + movl %pc@(_C_LABEL(SysBase):w),%a6 + jsr %a6@(-0x20a) + movml %sp@+, #0x4c00 + rts