HD6417660 RENESAS [Renesas Technology Corp], HD6417660 Datasheet - Page 131

no-image

HD6417660

Manufacturer Part Number
HD6417660
Description
Renesas 32-Bit RISC Microcomputer
Manufacturer
RENESAS [Renesas Technology Corp]
Datasheet
• Example 4: Repeat loop consisting of two instructions
In extended repeat control instructions, a repeat start instruction address and a repeat end
instruction address are stored in the RS register and RE register, respectively, regardless of the
number of repeat instructions. In addition, the extended repeat control can be performed by using
the LDRC instruction instead of the SETRC instruction. During the extended repeat control, a
repeat loop can be recognized by executing a repeat end instruction. Therefore, there is no
restriction on branches or exceptions.
Extended Repeat Control Instructions: To describe the extended repeat loop, the repeat start
and end addresses must be specified to the RS and RE registers by the LDRS and LDRE
instructions, respectively. For the LDRS and LDRE instructions of the extended repeat control
instructions, the LDRS and LDRE instructions of the compatible repeat control instructions are
used. The number of repetitions are specified by the LDRC instruction. An 8-bit immediate data
or the general register values can be used as an operand of the LDRC instruction. If 256 or greater
value is specified to the RC, use the LDRC Rm type instructions.
RptStart:
RptEnd:
LDRS RptStart
LDRE RptEnd
LDRC #4
instr0
instr1
; [Repeat start instruction]==
; Sets repeat start instruction address
; Sets repeat end instruction address
; Sets the number of repetitions (4) to
; [Repeat detection instruction]
to the RE register
[Repeat end instruction]
to the RS register
the RC[11:0] bits of the SR register
An instruction prior to the Repeat
start instruction is regarded as a
repeat detection instruction. At least
one instruction is required from LDRC
instruction to [Repeat start
instruction]
Rev. 1.00, 02/04, page 93 of 804

Related parts for HD6417660