Notes On Use Of Bit Manipulation Instructions - Hitachi H8/3006 Hardware Manual

Table of Contents

Advertisement

Operation field only
Operation field and register fields
op
Operation field, register fields, and effective address extension
op
Operation field, effective address extension, and condition field
op
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
Read
2
Modify
3
Write
Example 1: BCLR is executed to clear bit 0 in the port 4 data direction register (P4DDR) under
the following conditions.
P4
, P4
7
6
P4
– P4
5
The intended purpose of this BCLR instruction is to switch P4
40
op
EA (disp)
cc
Figure 2-9 Instruction Formats
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
:
Input pins
:
Output pins
0
rn
rm
rn
rm
EA (disp)
from output to input.
0
NOP, RTS, etc.
ADD.B Rn, Rm, etc.
MOV.B @(d:16, Rn), Rm
BRA d:8

Advertisement

Table of Contents
loading

This manual is also suitable for:

H8/3007Hd6413006Hd6413007

Table of Contents