On Mon, Feb 23, 2004 at 07:38:58PM -0500, Bob Ammerman wrote: > Indeed you want to use the INDF/FSR technique. > > FSR is a 'pointer' to a memory location. You set FSR to point to the correct > memory location, then reading or writing INDF really accesses the memory > location pointed to be FSR. > > So, you can iterate thru a group of locations: > > cblock 0x0C > foo:3 > endfoo:0 > cnt > endc Hello Bob, This works very well. Specifying a register with :0 size is a neat trick. It doesn't look like it takes up a GPR, yet I can use it to calculate the size of my 'foo' array. Does that sound correct? (Is this documented anywhere? I haven't come across any code that has used this, and now I find myself wondering, what other data structures access/manipulation techniques I may be unawares of) > If the PIC you are using has an IRP bit in the status register you have to > be sure it is correctly set, it is effectively an extra high it for the FSR > register. The datasheet for the 16f84a says 'The IRP bit is not used by the PIC16F8x. IRP should be maintained clear' Perhaps when I move on to the bigger PICS, I will need to consider this. Thanks. -v -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body