Usage Notes; Note On Tas Instruction Usage; Note On Bit Manipulation Instructions - Renesas H8S/2158 User Manual

16-bit single-chip microcomputer h8s family/h8s/2100 series
Table of Contents

Advertisement

Section 2 CPU
2.9

Usage Notes

2.9.1

Note on TAS Instruction Usage

The TAS instruction is not generated by the Renesas H8S and H8/300 series C/C++ compilers.
The TAS instruction can be used as a user-defined intrinsic function.
2.9.2

Note on Bit Manipulation Instructions

The BSET, BCLR, BNOT, BST, and BIST instructions read data from the specified address in
byte units, manipulate the data of the target bit, and write data to the same address again in byte
units. Special care is required when using these instructions in cases where a register containing a
write-only bit is used or a bit is directly manipulated for a port, because this may rewrite data of a
bit other than the bit to be manipulated.
Example: The BCLR instruction is executed for DDR in port 4.
P47 and P46 are input pins, with a low-level signal input at P47 and a high-level signal input at
P46. P45 to P40 are output pins and output low-level signals. The following shows an example in
which P40 is set to be an input pin with the BCLR instruction.
Prior to executing BCLR
P47
Input/output
Input
Pin state
Low
level
DDR
0
DR
1
Rev. 3.00 Jan 25, 2006 page 52 of 872
REJ09B0286-0300
P46
P45
P44
Input
Output
Output
High
Low
Low
level
level
level
0
1
1
0
0
0
P43
P42
P41
Output
Output
Output
Low
Low
Low
level
level
level
1
1
1
0
0
0
P40
Output
Low
level
1
0

Advertisement

Table of Contents
loading

Table of Contents