No the is no putchar function, you need to define it you're self.
Perhaps one of the reasons for obmitting the putchar function is to make the system more flexible... e.g you define if putchar uses the internal serial uart or a display device or any other device where you want the string to be displayed...
Topper :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
when using several string functions (i.e. sprintf) the linker complains a missing putchar().
Indeed it is not in the source files, only external references to putchar().
Am I missing something here?
I'm using SDCC 2.2.1 on W2K (cygwin).
Mario
Hi Mario.
No the is no putchar function, you need to define it you're self.
Perhaps one of the reasons for obmitting the putchar function is to make the system more flexible... e.g you define if putchar uses the internal serial uart or a display device or any other device where you want the string to be displayed...
Topper :-)
Hi Topper,
that makes sense. Thanks!
Mario
e.g. in sdcc/device/examples/mcs51/clock
So is there any examples showing how exactly I can write a putchar() to the UART?
Do tell me how to use printf ???
# include<stdio.h>
# include<8051.h>
void main(void)
{
printf("hallo");
}
How to do the above with sdcc ???