> >And the 18F family actually has 3 pairs of them, along with auto inc/dec >instructions for the FSR registers. Yet another advantage of the 18F parts. Very AVR-ish :) The AVR has three pointer regs, also usable as "normal" regs, X, Y, and Z. So in AVR: Point at the data, and set up how many bytes to transfer ldi ZL,low(Data_Array) ldi ZH,high(Data_Array) ldi Loop,Data_Array_Len Read_Loop: ld TEMP,Z+ ;Here, you might DO something with the data.. dec LOOP brne Read_Loop For a null terminated string in rom: ldi ZL,low(Data_Array*2) ;Data is stored in WORDS in the AVR flash ldi ZH,high(Data_Array*2) ;So the byte address needs to be doubled. ;The lowest bit then selects high/low byte of the word. Read_Loop: LPM ;Data is now in R0, similar to RETLW adiw ZL,1 ;Inc the pointer tst R0 ;Is the data null? breq Read_Done ;Here, you might DO something with the data.. rjmp Read_Loop Read_Done: ;dummy label Given that most of these instructions take only one clock (xtal) this is pretty fast. _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist