Fujitsu F2MC-8L MB89620 Series Hardware Manual page 305

8-bit microcontroller
Table of Contents

Advertisement

B Instructions
B.5 Bit Manipulation Instructions (SETB, CLRB)
The bit manipulation instructions use a different read operation to the normal
operation for some bits of peripheral function registers.
n Read-modify-write Operation
Bit manipulation instructions set to "1" (SETB) or clear to "0" (CLRB) the specified bit only of a
register or RAM location. However, as the CPU handles data in 8-bit units, the actual operation
consists of reading the 8-bit data, modifying the specified bit, then writing the result back to the
same address. This is called a read-modify-write operation.
Table B.5 shows the bus operation for bit manipulation instructions.
Table B.5 Bus Operation for Bit Manipulation Instructions
CODE
A0 to A7
A8 to AF
n Read Source When Executing Bit Manipulation Instructions
The read source for a read-modify-write of some I/O ports and interrupt request flag bits is
different than for a standard read.
I/O ports (Bit manipulation instructions)
l
For some I/O ports, a standard read reads the I/O pin values whereas a bit manipulation
instruction reads the output latch value. This is to prevent unintentionally modifying other output
latch bit values and is independent of the pin input/output direction or pin state.
l
Interrupt request flag bits (Bit manipulation instructions)
For interrupt request flag bits, a standard read reads the flag bit to determine whether an
interrupt has occurred. Bit manipulation instructions, however, always read interrupt request flag
bits as "1". This is to prevent unintentionally clearing the flag by writing "0" to the interrupt
request flag bit when performing bit manipulation of a different bit.
284
APPENDIX
MNEMONIC
~
Cycle
CLRB dir:b
4
SETB dir:b
Address bus
1
N + 1
dir
2
dir address
Data
3
dir address
Data
4
N + 2
Next instruction
Data bus
RD
WR
0
0
1
0
MB89620 series
RMW
1
0
1
1
0
0
1
0

Advertisement

Table of Contents
loading

Table of Contents