Searching \ for 'Indirect addressing' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=indirect+addressing
Search entire site for: 'Indirect addressing'.

Truncated match.
PICList Thread
'Indirect Addressing'
1995\07\31@115620 by Neil Thomson

flavicon
face
Hi,

       I've been lurking for a while now but now I'm stuck and need help!
I want to create a data table on-the-fly by providing the data byte and an
offset from the start of the table. (i.e not a ready made table and use retlw)

In case you're confused .....

I want to write a byte of data at the first location in my table. I then
increment a register to point to the next location in my table. Therefore I
assume that indirect addressing is the answer.

I've looked at the very short program in my data book to clear a block of RAM
and this seems very similar(Section on Indirect Addressing,FSR,INDF) except it
says that I can't write to the INDF register. I assume that you can only clear
the INDF register with clrf INDF

in fact here's the program they give .....

clears RAM locations 20h -2fh


       movlw   0x20
       movwf   FSR
NEXT    clrf    INDF
       incrf   FSR
       btfss   FSR,4   ;bit 4 indicates 16th byte I assume - '00010000'
       goto    NEXT
CONTINUE ......


It's probably really easy but it's got me stumped at the moment!

1995\07\31@151606 by Andrew Warren

face
flavicon
face
Neil Thomson <spam_OUTN.ThomsonTakeThisOuTspamFTEL.CO.UK> wrote:

>I want to [create a lookup table in RAM]
> ....
>I've looked at the very short program in my data book to clear a block of RAM
>and this seems very similar(Section on Indirect Addressing,FSR,INDF) except
>it says that I can't write to the INDF register.

Neil:

What they mean to say is that "INDF" isn't a physical register; when you write
to it, you actually write to the register pointed to by the FSR.  This is
exactly what you want.

Any instruction that works on other registers will work on INDF.

-Andy

--
Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
Fast Forward Engineering, Vista, California


'Indirect addressing'
1998\05\07@144356 by David Wong
flavicon
face
When indirectly addressing a register in Bank 1 do you have to set the
status, rp0 bit?
Or will the processor automatically access the appropriate register
based on the address.
Thanks
DW

1998\05\07@191756 by XYGAX

picon face
no you have to set the bank bits first !

1998\05\09@012552 by paulb

flavicon
face
XYGAX wrote:

> no you have to set the bank bits first !

 Mind you there is an "IRP" or Indirect Register Pointer bit reserved
for any time they happen to make a PIC with more than 256 bytes or RAM/
Registers.

 Cheers,
       Paul B.

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...