PIC16C770 Microchip Technology Inc., PIC16C770 Datasheet - Page 25

no-image

PIC16C770

Manufacturer Part Number
PIC16C770
Description
18/20-pin, 8-bit Cmos Microcontrollers With 10/12-bit A/d
Manufacturer
Microchip Technology Inc.
Datasheet
The INDF register is not a physical register. Address-
ing INDF actually addresses the register whose
address is contained in the FSR register (FSR is a
pointer). This is indirect addressing.
Reading INDF itself indirectly (FSR = 0) will produce
00h. Writing to the INDF register indirectly results in a
no-operation (although STATUS bits may be affected).
A simple program to clear RAM locations 20h-2Fh
using indirect addressing is shown in Example 2-1.
FIGURE 2-5:
2002 Microchip Technology Inc.
RP1:RP0
bank select
Note 1: For register file map detail see Figure 2-3.
location select
6
Direct Addressing
DIRECT/INDIRECT ADDRESSING
Data
Memory(1)
from opcode
00h
7Fh
Bank 0
00
0
80h
FFh
Bank 1
01
100h
17Fh
Bank 2
10
EXAMPLE 2-1:
An effective 9-bit address is obtained by concatenating
the 8-bit FSR register and the IRP bit (STATUS<7>), as
shown in Figure 2-5.
NEXT
CONTINUE
180h
1FFh
PIC16C717/770/771
Bank 3
11
movlw
movwf
clrf
incf
btfss
goto
:
IRP
bank select
0x20
FSR
INDF
FSR
FSR,4
NEXT
7
Indirect Addressing
How to Clear RAM Using
Indirect Addressing
;initialize pointer
;
;clear INDF register
;inc pointer
;all done?
;NO, clear next
;YES, continue
FSR register
to RAM
DS41120B-page 23
location select
0

Related parts for PIC16C770