Hi, when I use
printf("12345");
1234
prinf("12345\n")
The simulator actually simulates the real timing of the device. If you simulate the single instruction (SBUF = 'a') you won't see the letter 'a' appear in the serial window at the next instruction. The reason is that it takes 10 baud time for the letter 'a' to get 'shifted' out the serial port. So, the 'a' will not appear until many instructions later. Any time you invoke printf, immediately following the printf return you will see the output minus the last character. The reason for this is simple. If you look at the way the putchar function (which is how printf outputs characters) works, you'll find the following logic:
while (!TI); TI=0; SBUF = char_to_send;