Pular para o conteúdo principal
Knowledgebase
Home
Renesas Brasil - Knowledgebase

Can you describe the read-modify-write instruction in detail?

Latest Updated:08/05/2009

Question:

(CPU)
Please describe the read-modify-write instruction in detail. [2009/08/05]

Answer:

The read-modify-write instruction performs the following operations.

  1. Read data from a specified address.
  2. Process the bits specified in the read-out data.
  3. Write the data to the original address.

Data is written and read in byte units. When processing a bit or performing a logic operation, the data in the bits which are not specified in the data read out (in byte units) are not processed but are simply written to the original address.

[Example] SEB 2, RAM

Function Mnemonic
Bit processing CLB, SEB
Shift ASL, LSR, ROL, ROR, RRF
Arithmetic operation DEC, INC
Logic operation COM

In addition, add and subtract/logical operation instructions (ADC, SBC, AND, EOR, and ORA) when T flag = 1 operate in the way as the read-modify-write instruction.

(#107438)

Suitable Products
3803H
3803L
3823
3850A
3858
38D2
38D5
7544
7545
7546
7547
7548
7549