beautypg.com

Renesas SH7641 User Manual

Page 180

background image

Section 3 DSP Operation

Rev. 4.00 Sep. 14, 2005 Page 130 of 982

REJ09B0023-0400

CASE 4: 4 or More Repeated Instructions

LDRS

RptStart;

LDRE

RptEnd3+4;

SETRC

RptCount;

- - - -

RptStart0: instr0;

RptStart: instr1;

Repeated instruction 1

instr2;

Repeated instruction 2

instr3;

Repeated instruction 3

----------------------------------------------------------

RptEnd3: instrN-3;

Repeated instruction N-3

instrN-2;

Repeated instruction N-2

instrN-1;

Repeated instruction N-1

RptEnd:

instrN;

Repeated instruction N

instrN+1;

The examples above can be used as a template to program this repeat loop sequences. However,
for easy programming, an extended instruction REPEAT is provided to handle these complex
labeling and offset issues. Details will be described in the following note 2.

Note 2: Extended Instruction REPEAT

This REPEAT extended instruction will handle all the delicate labeling and offset processing
described in table 3.17 and note 1. The labels used here are:

Rptart:

An address of the instruction at the top of the repeat loop

RptEnd:

An address of the instruction at the bottom of the repeat loop

RptCount: Repeat count immediate number

This instruction can be used in the following way:

Here the repeat count can be specified as an immediate value #Imm or a register indirect value Rn.

This manual is related to the following products: