Processing Delayed Branching Instructions - Fujitsu FR Family Instruction Manual

32-bit microcontroller
Hide thumbs Also See for FR Family:
Table of Contents

Advertisement

5.4.2

Processing Delayed Branching Instructions

The FR family CPU processes delayed branching instructions with an apparent
execution speed of 1 cycle, regardless of whether branching conditions are satisfied or
not satisfied. When branching occurs, this is one cycle faster than using
non-delayed branching instructions.
However, the apparent order of instruction processing is inverted in cases where
branching occurs.
■ Examples of Processing Delayed Branching Instructions
Figure 5.4-3 shows an example of processing a delayed branching instruction when branching conditions
are satisfied.
In this example, the branch destination instruction, "ST R2,@R13" is executed after the instruction "ST
R2,@R12" in the delay slot. As a result, the branching instruction has an apparent execution speed of one
cycle. However, the instruction "ST R2,@R12" in the delay slot is executed before the branch destination
instruction "ST R2,@R13" and therefore the apparent order of processing is inverted.
Figure 5.4-3 Example: Processing a Delayed Branching Instruction (Branching Condition Satisfied)
LD @R10, R1
LD @R11, R2
ADD R1, R3
BNE:D TestOK(branching conditions satisfied)
ST R2, @R12(delay slot instruction)
ST R2, @R13(branch destination instruction)
: PC change
Figure 5.4-4 shows an example of processing a delayed branching instruction when branching conditions
are not satisfied.
In this example the delay slot instruction "ST R2,@R12" is executed without being canceled. As a result,
the program is processed in the order in which it is written. The branching instruction requires an apparent
processing time of one cycle.
Figure 5.4-4 Example: Processing a Delayed Branching Instruction (Branching Conditions Not Satisfied)
LD @R10, R1
LD @R11, R2
ADD R1, R3
BNE:D TestOK (branching conditions not satisfied)
ST R2, @R12 (delay slot instruction)
ADD #4, R12
CHAPTER 5 PRECAUTIONARY INFORMATION FOR THE FR FAMILY CPU
IF
ID
EX
MA
IF
ID
EX
IF
ID
IF
IF
ID
EX
MA
IF
ID
EX
IF
ID
IF
WB
MA
WB
EX
MA
WB
ID
EX
MA
WB
IF
ID
EX
MA
IF
ID
EX
WB
MA
WB
EX
MA
WB
ID
EX
MA
WB
IF
ID
EX
MA
IF
ID
EX
Not canceled
WB
MA
WB
Not canceled
WB
MA
WB
61

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fr series

Table of Contents