Hi: Old business: * The page0 - page1 problem is solved in my LCD clock program. Pushing PCLATH in the ISR and popping it at the end fixed it. *Leap Year can easily be calculated since in order to display the 2 byte integer year there is a conversion to 4 BCD digits. These are easily tested for MOD100 and MOD400, so Leap Year is now working. Also the Century for the Zeller Congruence Day of Week is just 10*Throusnds+Hundeds. New business: In order to calculate the Zeller Congruence the math needs to be 16 bit to handle the 4 digit Year so the Modulo 7 calculation needs to start with a two byte unsigned integer and output 0 to 6, but so far it's escaped me how to calculate it and there's not even a mention of modulo calculations on the piclist.com source code pages. The start of the loop may be something like: movlw 7 ; addwf with a -7 does not work Mod7_Loop subwf Z_DowLo,F btfsc STATUS,C ; for subtraction the sense of carry is inverted goto Mod7_Loop ; keep subtracting 7 until there's a carry but the next part has me stumped. For example in normal math at this point Z_DowLo would be negative and if this was a one byte MOD7 just adding 7 would bring it to the answer. So now we need a second loop that subtracts one from Z_DowHi and each time that's done makes an adjustment to Z_DowLo. But since this is a MOD7 calculation instead of adding 0xFF I tried adding 256MOD7 or 4 for each carry but it does not seem to work. Any ideas? Thanks, Brooke Clarke -- w/Java http://www.PRC68.com w/o Java http://www.pacificsites.com/~brooke/PRC68COM.shtml http://www.precisionclock.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist