Programming |  PIC's |  16F84A |  Indirect Addressing


The INDF register is used to read and write the register pointed to by the FSR register.

Clearing a range of RAM using indirect addressing

This example clears 0x20 to 0x2F using indirect addressing.
        movlw   0x20        ;initialize pointer
        movwf   FSR         ;to RAM
NEXT    clrf    INDF        ;clear INDF register
        incf    FSR         ;inc pointer
        btfss   FSR,4       ;all done?
        goto    NEXT        ;NO, clear next
CONTINUE
        :                   ;YES, continue