No, this has nothing to do with '51s, but I want the opinions of some of you tenured chaps: In a circular queue, what do you consider the head and what do you consider the tail? I've always know the tail as the point (index, whatever) that points to the next available free space in the buffer. That is, data is placed IN at the tail, and removed from the head position. I learned this definition years ago when digging into the IBM PC's keyboard buffer and a book on the topic listed the pointers as I describe above. That's how I've thought of them ever since and is how several google results describes them as well. You?
The old adage "comment for the benefit of others" may very well be true, but as we all, to some extent are egotistical, I like "comment for your own benefit" better. How true. Have you ever heard the argument "If you can't comment it in the code well enough for ANYONE to understand, then you don't understand it yourself"? I love that one.
In the interrupt-driven serial I/O routines I've written (http://www.keil.com/download/docs/intsio2.zip.asp) I name the head and tail in and out. I think that's pretty clear. Jon