]> git.sur5r.net Git - cc65/commitdiff
Replaced putchar by an assembler version
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 6 Oct 2004 21:42:17 +0000 (21:42 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 6 Oct 2004 21:42:17 +0000 (21:42 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3216 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/common/.cvsignore
libsrc/common/Makefile
libsrc/common/putchar.c [deleted file]
libsrc/common/putchar.s [new file with mode: 0644]

index 76d1d0b75761d1f35e85f08a2446832831635ece..adb36788890c96c1296d36ef403fd2c07a203e04 100644 (file)
@@ -24,7 +24,6 @@ locale.s
 localtime.s
 mktime.s
 perror.s
-putchar.s
 puts.s
 qsort.s
 realloc.s
index 312e6bf6a5a82d98affdd1851182e8e40c8020b6..9a14ffbed84da301025f150b006b7a4cc6cfc706 100644 (file)
@@ -42,7 +42,6 @@ C_OBJS =      _afailed.o      \
                 localtime.o     \
                 mktime.o        \
                perror.o        \
-               putchar.o       \
                puts.o          \
                qsort.o         \
                realloc.o       \
@@ -117,6 +116,7 @@ S_OBJS =    _cwd.o          \
                modload.o       \
                 oserrcheck.o    \
                printf.o        \
+               putchar.o       \
                rand.o          \
                 raise.o         \
                 remove.o        \
diff --git a/libsrc/common/putchar.c b/libsrc/common/putchar.c
deleted file mode 100644 (file)
index a98341a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * putchar.c
- *
- * Ullrich von Bassewitz, 11.12.1998
- */
-
-
-
-#include <stdio.h>
-#undef putchar         /* This is usually declared as a macro */
-
-
-
-/*****************************************************************************/
-/*                                          Code                                    */
-/*****************************************************************************/
-
-
-
-int __fastcall__ putchar (int c)
-{
-    return fputc (c, stdout);
-}
-
-
-
diff --git a/libsrc/common/putchar.s b/libsrc/common/putchar.s
new file mode 100644 (file)
index 0000000..d77f8d0
--- /dev/null
@@ -0,0 +1,20 @@
+;
+; Ullrich von Bassewitz, 2004-10-06
+;
+; int __fastcall__ putchar (int c);
+;
+
+               .export         _putchar
+        .import         _stdout
+        .import         _fputc
+
+
+.code
+
+_putchar:
+        lda     #<_stdout
+        ldx     #>_stdout
+        jmp     _fputc          ; __fastcall__ function
+
+
+