Bit Manipulation Instructions (Setb, Clrb); Table B.3-1 Bus Operation For Bit Manipulation Instructions - Fujitsu F2MC-8L Series Hardware Manual

8-bit microcontroller
Hide thumbs Also See for F2MC-8L Series:
Table of Contents

Advertisement

B.3

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.
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.3-1 shows the bus operation for bit manipulation instructions.

Table B.3-1 Bus Operation for Bit Manipulation Instructions

CODE
MNEMONIC
A0 to A7
CLRB dir:b
A8 to AF
SETB dir:b
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 that for a standard read.
I/O ports (Bit manipulation instructions)
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, regardless of the pin input/output direction or pin state.
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.
~
Cycle
Address bus
4
1
N + 1
2
dir address
3
dir address
4
N + 2
APPENDIX B Overview of Instructions
Data bus
RD
dir
0
Data
0
Data
1
Next instruction
0
WR
RMW
1
0
1
1
0
0
1
0
317

Advertisement

Table of Contents
loading

Table of Contents