>> _wreg_init: >> CLR W0 >> MOV W0, W14 >> REPEAT #12 >> MOV W0, [++W14] >> CLR W14 >> RETURN W0 thru W15 are memory locations 0..31. The above loop clears the memory locations associated with W1 thru W13 How, you ask? CLR W0 W0<-0 MOV W0,W14 W14<-0 REPEAT #12 Repeat next instruction 13! times MOV W0,[++W14] Does the following: Adds 2 to W14 Moves W0 (which is zero) to the memory location pointed to by W14 CLR W14 W14<-0 --- Bob Ammerman RAm Systems >> > > It prevents buggy code from generating an uninitialized W register > reset, which is caused by using an uninitialized W register as an > address. This code pretty much defeats the whole point of the > uninitialized W register reset feature. > > -- > John W. Temples, III > But this is only doing something to W0 and W14...or am I wrong? I'm really trying to get my head around this! -- Regards, Stephen D. Barnes -- 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