How printf()s work under C51?

Can any body tell me how printf() and the likes work under C51? If I don't have a display device, where does the output go? If I don't have a kernel and still want to use the functions and redirect the output to the serial port what should I implement first? I have already implemented a putch() function. Can I use it?

I'm a rookie here in C51. Would you help me on that? Thanks very much.

Parents
  • All of the I/O routines (printf, scanf, puts, and so on) output characters using the putchar routine and input characters using the _getkey routine. The source for each of these routines is provided.

    The default for putchar is to outout characters on the 8051's serial port.

    The default for _getkey is to input characters on the 8051's serial port.

    You may rewrite these routines, however, to send characters wherever you want.

    Jon

Reply
  • All of the I/O routines (printf, scanf, puts, and so on) output characters using the putchar routine and input characters using the _getkey routine. The source for each of these routines is provided.

    The default for putchar is to outout characters on the 8051's serial port.

    The default for _getkey is to input characters on the 8051's serial port.

    You may rewrite these routines, however, to send characters wherever you want.

    Jon

Children
No data
More questions in this forum