Supplementary Explanation For Bset, Bclr, Lock And Unlock Instruction Execution; Precautions On Cpu - Renesas M32R/ECU Series User Manual

Mitsubishi 32-bit risc single-chip microcomputers
Table of Contents

Advertisement

2

2.7 Supplementary Explanation for BSET, BCLR, LOCK and UNLOCK Instruction Execution

2.7 Supplementary Explanation for BSET, BCLR, LOCK and UNLOCK
Instruction Execution
The LOCK bit is set when executing the BSET or BCLR instruction, and is cleared when the BSET or BCLR
instruction finishes.
The LOCK instruction sets the LOCK bit, as well as performs an ordinary load operation. The UNLOCK instruction
is used to clear the LOCK bit.
The LOCK bit is located inside the CPU, and cannot directly be accessed for read or write by users. This bit
controls granting of bus control requested by devices other than the CPU.
• When LOCK bit = "0"
Control of the bus requested by devices other than the CPU is granted
• When LOCK bit = "1"
Control of the bus requested by devices other than the CPU is denied
In the 32180 group, control of the bus may be requested by devices other than the CPU in the following two cases:
• When DMA transfer is requested by the internal DMAC
• When HREQ# input is pulled low to request that the CPU be placed in a hold state

2.8 Precautions on CPU

• Usage Notes for 0 Division Instruction
Problem and Conditions
Inaccurate calculations for the instructions listed in (2) will result from execution of the 0 division instruction
under the conditions described in (1).
(1) If 0 division calculation is executed when the divisor = 0 for instructions DIV, DIVU, REM and REMU,
(2) the result will be inaccurate calculations for any of the following instructions that are executed immedi-
ately after 0 division:
ADDV, ADDX, ADD, ADDI, ADDV3, ADD3,
CMP, CMPU, CMPI, CMPUI,
SUBV, SUBX, SUB,
DIV, DIVU,
REM, REMU.
Countermeasure
Assuming that the 0 division occurrence itself is not expected by the system and therefore is the cause of
miscalculations, before executing division or remainder instructions, do a 0 check on the divisor to make sure 0
division does not occur.
2-14
32180 Group User's Manual (Rev.1.0)
CPU

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents