Notes On Use Of Bit Manipulation Instructions; Figure 2.9 Instruction Formats - Hitachi H8/3062 Hardware Manual

Single-chip microcomputer h8/3062 series; h8/3062b series; h8/3062f-ztat series; h8/3064f-ztat series
Hide thumbs Also See for H8/3062:
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
:
Input pins
7
6
P4
– P4
: Output pins
5
0
The intended purpose of this BCLR instruction is to switch P4
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
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
51

Advertisement

Table of Contents
loading

Table of Contents