Shop OBEX P1 Docs P2 Docs Learn Events
usage of INDF???? — Parallax Forums

usage of INDF????

JonJonJonJon Posts: 20
edited 2005-02-12 11:27 in General Discussion
Guys,

What is the meaning of 'INDF' as applied below:

··mov·INDF,W

Where W = value not location.· I find it as a reserved word but I cannot find a description.

Regards,

JJ



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think you’re a Big-Shot?
Try ordering someone else’s dog around.
·
Jon K. Zachary
Katy, TX

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-02-12 04:44
    i think its the same as IND (indirect) but I'm not positive
  • LemonLemon Posts: 34
    edited 2005-02-12 04:53
    I used the following code:

    mov w,#$35
    mov fsr,w
    mov w,#$30
    mov INDF,w

    The result was excatly the same as it would have been using IND - the byte at $35 got the walue of #$30.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Why do·they call it a spacestation? There's hardly "space" for anything in there.
  • JonJonJonJon Posts: 20
    edited 2005-02-12 05:01
    Kool...

    I think I'm getting it now.

    mov INDF,w

    will store the value of 'w' at the location in 'FSR' for the current bank....

    correct???

    Regards,

    JJ

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think you’re a Big-Shot?
    Try ordering someone else’s dog around.
    ·
    Jon K. Zachary
    Katy, TX
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-02-12 05:12
    You got it, but its not subject to bank limitations. Its useful for stacks, arrays, or any data structure that is best defined by a pointer. It does act somwhat goofy but in the same way as the memory spacing is done, so its easy enough to use if you understand the memory organization (I have written stack routines that use indirection and automatically skips·over all the global register mappings).

    Post Edited (Paul Baker) : 2/12/2005 5:16:05 AM GMT
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-02-12 11:27
    Yes, confirmative...

    IND and INDF are synonyms. Both mean "apply some operation" (like a MOV, DEC, ADD, etc.) to any of the SX file registers whose address is specified by the current contents of the FSR (the File Select Register). This is usually called INDicect addressing, or an INDirect File address.

    As Paul mentioned, indirect addressing of the SX registers is a great method to access any SX register without beeing tied to the memory bank concept. I mostly use it for FIFOs (or circular) buffers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
Sign In or Register to comment.