Well, if you move the STATUS into WREG without first saving its content you loose it. The order to save W and then STATUS is just perfect. Actually you could use MOVF to save STATUS as virtually there is no way when STATUS is 0 as there is the NOT_TO and NOT_PD - see the original templates from Microchip in your MPASM folder. But there is no real reason not to use SWAPF, it does not hurt to be honest - occupies the same space in program memory, takes the very same amount of time when executed, but it works correctly in all theoretical situations. However, you cannot avoid SWAPF stuff to restoring WREG really. You have to do it at the very last moment after STATUS already had been restored, so you would like to keep all flags as it is. Tamas On 6/13/07, KPL wrote: > > > SWAPF is used as that does not affect any of the STATUS bits, (MOVF > would > > change Z flag...) > > Now I see that from instruction description, but the same could be > done using ordinary movf, just have to save STATUS first, and W after > that, so status change do not affect anything? Am I missing something? > OK, it just became clear to me, we would overwrite W while saving STATUS. > Fine. > > > > > For realtime clock you can see examples at piclist techref library: > > http://www.piclist.com/techref/microchip/time.htm > > that's the first place I check when need something:) > > > > > Regards, > > Tamas > > > > > -- > KPL > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist