in C51, the default printf() is used for serial comm., depends on putchar.c now, i'm trying to modify it(putchar.c) for my 8-bit LCD.
the question is, can putchar.c or printf() be used on both, serial comm. and 8-bit LCD, at same time (at the same main program)?
nb: i want to display floating point, that's why i'm trying to use printf()
Not in C51, you can't:
http://www.keil.com/support/man/docs/c51/c51_xa_librarydif.htm
You would have to create your own...
"You would have to create your own..."
Which isn't very hard to do. Either by use of our friend "sprintf()" or by setting a global variable to inform where the data is expected to be sent and have a putchar() that looks at that global variable. Just as long as the fprintf() implementation resets that global variable after the call so direct use of printf() doesn't get the output rerouted.
A large part of the C runtime library is standard C code, and potentially using other C RTL functions. And the parts that isn't standard C is normally assembler for extra speed or size gains - not because of limitations the C language.
In the end, the user doesn't need any presupplied file system implementation to be able to play with fprintf(), fputs(), fgets(), fputchar(), ...