Olin Lathrop wrote: > > I didn't look at your code, but my immediate knee jerk reaction is that > keeping AM/PM flags around is a bad design choice. Use 24 hour time > internally. Whether you then display 24 hour or 12 hour time with > AM/PM is > only a matter of the display logic. Given that a deliberate design choice was that this clock will only ever display 12-hour time, I don't see that there's an overall advantage in storing the time in 24-hour format. Yes, it would simplify my "add 1 minute" routine, taking the AM/PM logic out of that routine - but all that does is move some fairly equivalent logic into the display routine. There's not much in that trade-off, but keeping the internal time format closely matched to the display format (to me) makes the code clearer overall. > > So finally to the point. Does anyone know an elegant way to compare > > (XOR) two bits in the same register, using midrange PIC instructions? > > Why does it need to be elegant? The extra cycles are irrelevant. That's true (to a point of course). > Write it to make the most sense when someone reads the code. Yes - I hoped that someone had an idea that was actually easier to follow than a set of four bit tests. > This includes giving symbolic names to the bits. Had you looked at my code you would have seen that I had done that... David Meiklejohn www.gooligum.com.au -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist