English
Language : 

HD64F3028F25 Datasheet, PDF (71/925 Pages) Renesas Technology Corp – Hardware Manual Renesas 16-Bit Single-Chip Microcomputer H8 Family/H8/300H Series
2.6.5 Notes on Use of Bit Manipulation Instructions
The BSET, BCLR, BNOT, BST, and BIST instructions read a byte of data, modify a bit in the
byte, then write the byte back. Care is required when these instructions are used to access registers
with write-only bits, or to access ports.
Step
1
2
3
Read
Modify
Write
Description
Read one data byte at the specified address
Modify one bit in the data byte
Write the modified data byte back to the specified address
Example 1: BCLR is executed to clear bit 0 in the port 4 data direction register (P4DDR) under
the following conditions.
P47, P46: Input pins
P45 – P40: Output pins
The intended purpose of this BCLR instruction is to switch P40 from output to input.
Before Execution of BCLR Instruction
Input/output
DDR
P47
Input
0
P46
Input
0
P45
Output
1
P44
Output
1
P43
Output
1
P42
Output
1
P41
Output
1
P40
Output
1
Rev. 2.00, 09/03, page 39 of 890