int rename (const char* old, const char* new);
int sprintf (char* buf, const char* format, ...);
int __fastcall__ vfprintf (FILE* f, const char* format, va_list ap);
-int vprintf (const char* format, va_list ap);
+int __fastcall__ vprintf (const char* format, va_list ap);
int __fastcall__ vsprintf (char* buf, const char* format, va_list ap);
/* Not available or testing: */
strftime.s
strtok.s
strxfrm.s
+system.s
timezone.s
-vprintf.s
vsscanf.s
strtok.o \
system.o \
timezone.o \
- vprintf.o \
vsscanf.o
tolower.o \
toupper.o \
vfprintf.o \
+ vprintf.o \
vsprintf.o \
zerobss.o
+++ /dev/null
-/*
- * vprintf.c
- *
- * Ullrich von Bassewitz, 11.08.1998
- */
-
-
-
-#include <stdarg.h>
-#include <stdio.h>
-#include "_printf.h"
-
-
-
-int vprintf (const char* format, va_list ap)
-{
- return vfprintf (stdout, format, ap);
-}
-
-
-
--- /dev/null
+;
+; Ullrich von Bassewitz, 2003-06-02
+;
+; int __fastcall__ vprintf (const char* format, va_list ap);
+;
+
+ .export _vprintf
+ .import _vfprintf, _stdout
+ .import decsp2
+ .importzp sp
+
+
+.proc _vprintf
+
+; Save A which contains the low part of ap
+
+ pha
+
+; Allocate one more word on the stack
+
+ jsr decsp2
+
+; Move the format parameter down and store stdout in it's place
+
+ ldy #2
+ lda (sp),y
+ ldy #0
+ sta (sp),y
+ ldy #3
+ lda (sp),y
+ ldy #1
+ sta (sp),y
+
+ iny
+ lda _stdout
+ sta (sp),y
+ iny
+ lda _stdout+1
+ sta (sp),y
+
+; Restore A
+
+ pla
+
+; Call vfprintf (stdout, format, ap) which will cleanup the stack and return
+
+ jmp _vfprintf
+
+.endproc
+
+