Before Execution of BCLR Instruction
Execution of BCLR Instruction
BCLR #0, @P4DDR
;clear bit 0 in data direction register
After Execution of BCLR Instruction
Explanation: To execute the BCLR instruction, the CPU begins by reading P4DDR. Since
P4DDR is a write-only register, it is read as H'FF, even though its true value is H'3F.
Next the CPU clears bit 0 of the read data, changing the value to H'FE.
Finally, the CPU writes this value (H'FE) back to P4DDR to complete the BCLR instruction.
As a result, P4
0
DDR is cleared to “0,” making P4
0
an input pin. In addition, P4
7
DDR and P4
6
DDR
are set to “1,” making P4
7
and P4
6
output pins.
P4
7
P4
6
P4
5
P4
4
P4
3
P4
2
P4
1
P4
0
Input/output
Input
Input
Output Output Output Output Output Output
Pin state
Low
High
Low
Low
Low
Low
Low
Low
DDR
0
0
1
1
1
1
1
1
DR
1
0
0
0
0
0
0
0
P4
7
P4
6
P4
5
P4
4
P4
3
P4
2
P4
1
P4
0
Input/output
Output Output Output Output Output Output Output Input
Pin state
Low
High
Low
Low
Low
Low
Low
High
DDR
1
1
1
1
1
1
1
0
DR
1
0
0
0
0
0
0
0
45
Summary of Contents for H8/326 Series
Page 67: ...58 ...
Page 121: ...112 ...
Page 274: ... 3 Clock Settling Timing Ø VCC RES STBY tOSC1 tOSC1 Figure 14 8 Clock Setting Timing 265 ...
Page 279: ...270 ...