beautypg.com

Renesas SH7641 User Manual

Page 262

background image

Section 9 Exception Handling

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

REJ09B0023-0400

• Example 3: Repeat loop consisting of two instructions

LDRS

RptDtct + 6

; [A]

LDRS

RptDtct + 4

; [A]

SETRCT

#4

;

[A]

RptDtct: RptDtct

; [B] A repeat detection instruction is an

instruction

prior

to

a

repeat

start

instruction

RptStart:

RptDtct1

; [C1][Repeat start instruction]

RptEnd: RptDtct3

; [C2][Repeat end instruction]

InstrNext

;

[A]

• Example 4: Repeat loop consisting of one instruction

LDRS

RptDtct + 8

; [A]

LDRS

RptDtct + 4

; [A]

SETRCT

#4

;

[A]

RptDtct: RptDtct

; [B] A repeat detection instruction is an

instruction

prior

to

a

repeat

start

instruction

RptStart:

RptEnd: RptDtct1

; [C1][Repeat start instruction]== [Repeat end

instruction]

InstrNext

;

[A]

SPC Saved by an Exception in Repeat Control Period: If an exception is accepted in the repeat
control period while the repeat counter (RC11 to RC0) in the SR register is two or greater, the
program counter to be saved may not indicate the value to be returned correctly. To execute the
repeat control after returning from an exception processing, the return address must indicate an
instruction prior to a repeat detection instruction. Accordingly, if an exception is accepted in
repeat control period, an exception other than re-execution type exception by a repeat detection
instruction cannot return to the repeat control correctly.

This manual is related to the following products: