Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/27/07 12:34
Read: times


 
#138107 - why "C"
Responding to: ???'s previous message
Andy Neil said:
Surely, this has nothing specifically to do with 'C'?

If you were to set TI in assembler (implicitly or explicitly) with serial interrupts enabled, you'd get exactly the same!?

Certainly.

The difference is, so to say, educational, or psychological.

Those who do asm usually read the relevant parts of "bible", and once they start writing a serial ISR they are mostly aware of how the TI/RI stuff works. I see it very unlikely that somebody in asm would experiment with mixed polled transmission and interrupt-based reception.

On the other hand, the C-user learns pretty quickly (perhaps in Lesson 1, Hello world!) how to use printf. He doesn't want to be bothered by the details, so he simply copies out the example from the manual (or example application - the SDCC manual "library functions" section avoids this problem simply by providing little enough information with the headline "this is messy and incomplete" :-P ) - here is where setting TI came, maybe even in the "hidden" form (by setting a value of 0x52 into SCON).

Later, he finds an another example, this time an interrupt-driven reception - and puts things simply together...

This of course might (will) happen with any higher level language so this is not my usual C-hater Pascal-lover rant (and also might happen in asm, given enough - and bad enough - "examples").


JW


List of 11 messages in thread
TopicAuthorDate
Serial ISR and TIC or Timer 2            01/01/70 00:00      
   Calling printf from within an ISR...            01/01/70 00:00      
      It is worse than that            01/01/70 00:00      
         Cross-Reference            01/01/70 00:00      
   Serial interrupt            01/01/70 00:00      
      Thanks to you all again            01/01/70 00:00      
         why \"somehow\"?            01/01/70 00:00      
            Nothing to do with 'C'?            01/01/70 00:00      
               why "C"            01/01/70 00:00      
               made it a FAQ            01/01/70 00:00      
               Nothing wrong with setting TI            01/01/70 00:00      

Back to Subject List