Hi, I am thinking about controller for hydroponic greenhouse, so I need real time clock. I am looking thru several examples that I can find on web, and have found this code: http://www.bobblick.com/techref/projects/propclock/mclock8.asm Question is - why the original author is swapping nibbles, when saving STATUS byte, in interrupt routine? It is reswapped back again, when restoring. ;-------- ; INTERRUPT SERVICE ROUTINE ;-------- org 0x04 ;interrupt vector Intsvc movwf safe_w ;save w swapf STATUS,w ;swap status, w movwf safe_s ;save status(nibble swap, remember) ;-------- ; done saving, now start working ;-------- ;-------- ; done working, start restoring ;-------- swapf safe_s,w ;fetch status, reswap nibbles movwf STATUS ;restore status swapf safe_w,f ;swap nibbles in preparation swapf safe_w,w ;for the swap restoration of w bcf INTCON,2 ;clear interrupt flag before return retfie ;return from interrupt Anybody knows some good (well commented :) real time clock sources to look thru? -- KPL -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist