Section 2 CPU
Rev. 7.00 Mar 10, 2005 page 72 of 652
REJ09B0042-0700
To avoid this problem, store a copy of the PCR3 data in a work area in memory. Perform the bit
manipulation on the data in the work area, then write this data to PCR3.
[A: Prior to executing BCLR]
MOV. B #3F, R0L The PCR3 value (H'3F) is written to a work area in memory
MOV. B R0L, @RAM0 (RAM0) as well as to PCR3.
MOV. B R0L, @PCR3
P3
7
P3
6
P3
5
P3
4
P3
3
P3
2
P3
1
P3
0
Input/output Input Input Output Output Output Output Output Output
Pin state Low level High level Low level Low level Low level Low level Low level Low level
PCR300111111
PDR310000000
RAM000111111
[B: BCLR instruction executed]
BCLR #0 , @RAM0 The BCLR instruction is executed designating the PCR3
work area (RAM0).
[C: After executing BCLR]
MOV. B @RAM0, R0L The work area (RAM0) value is written to PCR3.
MOV. B R0L, @PCR3
P3
7
P3
6
P3
5
P3
4
P3
3
P3
2
P3
1
P3
0
Input/output Input Input Output Output Output Output Output Output
Pin state Low level High level Low level Low level Low level Low level Low level High level
PCR300111110
PDR310000000
RAM000111110
Table 2.12 lists the pairs of registers that share identical addresses. Table 2.13 lists the registers
that contain write-only bits.