The datasheet explicitly says that PRE and POST INC/DEC are applied to the 12-bit value in FSRxH:FSRxL, so I am pretty certain this will work fine. Bob Ammerman RAm Systems ----- Original Message ----- From: "Scott Dattalo" To: Sent: Tuesday, August 20, 2002 9:41 AM Subject: Re: [PIC]: Challenge: 18F Clear RAM > On Tue, 20 Aug 2002, Bob Ammerman wrote: > > > Well great... and I figured you have a twelve instruction loop that would do > > 8 locations at a time. > > The 12-instruction thing was just to prevent someone from writing a > program of 4096 CLRF's and claiming that's the fastest way to clear > memory. Also, 12 is that mystical number that Dmitry always manages to > encounter. > > > > > 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 > > That'll do it! (Assuming that FSR0H:L rolls over from 0x000 to 0xfff). > > Scott > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads