* device/include/pic16/pic18fregs.h,
[fw/sdcc] / device / lib / printf_tiny.c
index 4d8543854f643a5d7b31b69d538056f6e4f9ef34..0ebded46115da41f7600453ac15a711fa04a74d2 100644 (file)
 
 
 
-void printf_tiny(code char *fmt, ...) reentrant
+void printf_tiny(__code char *fmt, ...) __reentrant
 {
        fmt;    /* suppress unreferenced variable warning */
 
-       _asm
+       __asm
 
 printf_begin:
        mov     a, _bp          // r0 will point to va_args (stack)
@@ -131,6 +131,7 @@ printf_str_loop:
 printf_format_c:
        //cjne  a, #'c', printf_format_d
        cjne    a, #99, printf_format_d
+       dec     r0
        mov     a, @r0          // Acc has the character to print
        dec     r0
        lcall   printf_putchar
@@ -284,9 +285,8 @@ printf_ret:
 
 
 printf_end:
-       _endasm;
+       __endasm;
 }
 
 
 #endif // defines compatible with printf_tiny
-