Edson Brusque wrote: > I want to shift the values inside a buffer and I know I can do: > > MOVF buf1,W > MOVWF buf0 // buf0 = buf1 > MOVF buf2,W > MOVWF buf1 // buf1 = buf2 > MOVF buf3,W > MOVWF buf2 // buf2 = buf3 > MOVF buf4,W > MOVWF buf3 // buf3 = buf4 > CLRF buf4 // buf4 = 0 Edson: That's the fastest way to shift the values... But if you have a lot of values (more than 4), it might be faster and take less code space to avoid shifting altogether. Instead of shifting, make the buffer circular and just change the value of a pointer into the buffer. -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.