Well great... and I figured you have a twelve instruction loop that would do 8 locations at a time. Doing 4 at a time with 10 instructions: execution time is roughly 2 instructions per memory byte. lfsr 0,0 movlw 0x0F loop: clrf POSTINC0 clrf POSTINC0 clrf POSTINC0 clrf POSTINC0 btfsc FSR0L,7 cpfseq FSR0H bra loop By adding 4 more clrf's you'll have 14 instructions, but execution time will drop to roughly 1.5 instructions per byte. Bob Ammeramn RAm Systems ----- Original Message ----- From: "Scott Dattalo" To: Sent: Monday, August 19, 2002 5:56 PM Subject: Re: [PIC]: Challenge: 18F Clear RAM > On Mon, 19 Aug 2002, Bob Ammerman wrote: > > > > Er.... > > > > > > My last response is STILL not right.... > > > > > > bit FSR0,7 is not implemented and always reads as zero. > > > > Ok Scott, what is the answer? > > Well, I don't know about *the* answer, but here are a couple of ideas: > > lfsr 0,0xf7f > loop1 > clrf postdec0 > tstfsz fsr0h > bra loop1 > > loop2 > clrf postdec0 > tstfsz fsr0l > bra loop1 > > clrf postdec0 > > > or a slow solution > > lfsr 0xf7f > > loop > clrf postdec0 > movf fsr0l,w > iorwf fsr0h,w > bnz loop > > clrf indf0 > > or > > > lfsr 0xf7f > > loop > clrf postdec0 > movf fsr0h,w > bnz loop > tstfsz fsr0l > bra loop > > clrf indf0 > > > Scott > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads