Bit Manipulation Instructions (Setb And Clrb); Read-Modify-Write Operation - Fujitsu F2MC-8L F202RA Hardware Manual

F2mc-8l 8-bit microcontroller
Hide thumbs Also See for F2MC-8L F202RA:
Table of Contents

Advertisement

B.3

Bit Manipulation Instructions (SETB and CLRB)

Some registers of peripheral functions have bits that perform a read operation different
from ordinary read for a bit manipulation instruction.

Read-modify-write Operation

The bit manipulation instructions can set "1" (SETB) to the specified bit in a register or RAM or clear it to
"0" (CLRB). Because the CPU handles the data in 8 bits, however, it actually reads the 8-bit data, modifies
the specified bit, and then writes it back to the original address. This series of operations is called read-
modify-write operation.
Table B.3-1 shows the bus operation at bit manipulation instructions.
Table B.3-1 Bus Operation at Bit Manipulation Instructions
CODE
MNEMONIC
A0 to A7
CLRB dir:b
A8 to AF
SETB dir:b
Read Destination at Execution of a Bit Manipulation Instruction
For some I/O ports and interrupt request flag bits, the read destination for read-modify-write is different
from that for ordinary read.
● I/O port (at bit manipulation)
For some I/O ports, the value of the I/O pin is read at ordinary read; meanwhile, the value of output latch is
read at bit manipulation. This is to prevent the other bits of the output latch from being accidentally
changed regardless of the I/O direction and pin state.
● Interrupt request flag bit (at bit manipulation)
The interrupt request flag bits work as flag bits for confirming an interrupt request at ordinary read;
meanwhile, "1" is always read at bit manipulation. This is to prevent the interrupt request flag bits from
being written as "0", and accidentally clearing the flags at bit manipulation for another bit.
~
Cycle
Address bus
4
1
N+1
2
dir address
3
dir address
4
N+2
Data bus
RD
Dir
0
Data
0
Data
1
Next operation
0
WR
RMW
1
0
1
1
0
0
1
0
391

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-8l mb89202Mb89202/f202ra series

Table of Contents