Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 2: Core SFRs
jump to the subroutine PP2 address.
Fig. 2-17 PCLATH Registers
In both cases, when the subroutine reaches instructions RETURN, RETLW or RETFIE (to return to the main program), the
microcontroller will simply continue program execution from where it left off because the return address is pushed and
saved onto the stack which, as mentioned, consists of 13-bit registers.
Indirect addressing
In addition to direct addressing which is logical and clear by itself (it is sufficient to specify address of some register to
read its contents), this microcontroller is able to perform indirect addressing by means of the INDF and FSR registers. It
sometimes considerably simplifies program writing. The whole procedure is enabled because the INDF register is not true
one (physically does not exist), but only specifies the register whose address is located in the FSR register. Because of this,
write or read from the INDF register actually means write or read from the register whose address is located in the FSR
register. In other words, registers’ addresses are specified in the FSR register, and their contents are stored in the INDF
register. The difference between direct and indirect addressing is illustrated in the figure 2-18 below:
As seen, the problem with the “missing addressing bits” is solved by “borrowing” from another register. This time, it is the
seventh bit called IRP from the STATUS register.
http://www.mikroe.com/en/books/picmcubook/ch2/ (11 of 12)5/3/2009 11:32:08 AM