Hi. Why does TI need to be set before printf is called.
TI = 1; printf("Hello world\n");
Whereas in assembly TI should be cleared before a char is put in SBUF, so it can be tested to see if the char has been sent
This is because the lib routine 'putchar.c' which is called by printf will be in a hard loop waiting for !TI. The following fragment is taken from the putchar.c source code in the Lib folder. You can modify or write your own putchar. You "Hello World" code had to set the TI bit the first time though the call.
while (!TI); TI = 0; return (SBUF = c);