Specifications

Chapter 2 - Microcontroller PIC16F84
Bsf STATUS, RP0 ;Bankl
movlw 0xFF ;w=0xFF
movwf TRISA ;address of TRISA register is taken from
;instruction movwf
Direct addressing
Indirect Addressing
Indirect unlike direct addressing does not take an address from an instruction but makes it with
the help of IRP bit of STATUS and FSR registers. Addressed location is accessed via INDF register
which in fact holds the address indicated by a FSR. In other words, any instruction which uses
INDF as its register in reality accesses data indicated by a FSR register. Let's say, for instance,
that one general purpose register (GPR) at address 0Fh contains a value of 20. By writing a value
of 0Fh in FSR register we will get a register indicator at address 0Fh, and by reading from INDF
register, we will get a value of 20, which means that we have read from the first register its value
without accessing it directly (but via FSR and INDF). It appears that this type of addressing does
not have any advantages over direct addressing, but certain needs do exist during programming
which can be solved smoothly only through indirect addressing.
http://www.mikroelektronika.co.yu/english/product/books/PICbook/2_06Poglavlje.htm (4 of 5) [4/2/2003 16:17:50]