1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Pointers in PIC?

Discussion in 'Microcontrollers' started by RawTechie, Jun 4, 2003.

  1. RawTechie

    RawTechie New Member

    Joined:
    May 29, 2003
    Messages:
    9
    Likes:
    0
    Hi, to the great PIC assembly language programmers out there, i need some help with assembly language.

    Consider the following code:

    POINTER equ 0x23 ;so POINTER is pointing to location 0x23

    can I get POINTER to point to the next location (i.e. 0x24)?
    TIA!
     
  2. kinjalgp

    kinjalgp Active Member

    Joined:
    Oct 28, 2002
    Messages:
    1,851
    Likes:
    3
    Location:
    INDIA/USA
    Here POINTER is not "C" like pointer but it is a Byte Variable Declared whose address is 0x23. Or in other words for ease of programming, the byte at 0x23 is aliased as "POINTER".
     
  3. RawTechie

    RawTechie New Member

    Joined:
    May 29, 2003
    Messages:
    9
    Likes:
    0
    yeah thanks..anyway, i figured out how to do what i wanted to do.
    The PIC has an FSR register that acts as a pointer. Simply load the FSR with the address and access the address via the INDF register once the FSR is pointing to the right address.
     

Share This Page