Illegal Slot Instruction; General Illegal Instructions - Hitachi SH7032 Hardware Manual

Superh risc engine
Table of Contents

Advertisement

4.5.3

Illegal Slot Instruction

An instruction located immediately after a delayed branch instruction is called an "instruction
placed in a delay slot." If an undefined instruction is located in a delay slot, illegal slot instruction
exception handling begins executing when the undefined code is decoded. Illegal slot instruction
exception handling also begins when the instruction located in the delay slot is an instruction that
rewrites the program counter. In this case, exception handling begins when the instruction that
rewrites the PC is decoded. The CPU performs illegal slot exception handling as follows:
1. Saves the status register onto the stack.
2. Pushes the program counter value onto the stack. The PC value saved is the branch destination
address of the delayed branch instruction immediately before the instruction that contains the
undefined code or rewrites the PC.
3. Fetches the exception handling routine start address from the vector table corresponding to the
exception that occurred, branches to that address, and starts executing the program. The branch
is not a delayed branch.
4.5.4

General Illegal Instructions

If an undefined instruction located other than in a delay slot (immediately after a delayed branch
instruction) is decoded, general illegal instruction exception handling is executed. The CPU
follows the same procedure as for illegal slot exception handling, except that the program counter
(PC) value pushed on the stack in general illegal instruction exception handling is the start address
of the illegal instruction with the undefined code.
62

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents