beautypg.com

6 software interrupts, Software interrupts – FUJITSU F2MCTM-16LX User Manual

Page 88

background image

72

CHAPTER 3 INTERRUPTS

3.6

Software Interrupts

In response to execution of a special instruction, control is transferred from the
program currently executed by the CPU to the interrupt processing program defined by
the user. This is called the software interrupt function. A software interrupt occurs
always when the software interrupt instruction is executed.

Software Interrupts

The CPU performs the following processing when a software interrupt occurs:

Saves the values in the PC, PS, AH, AL, PCB, DTB, ADB, and DPR registers of the CPU to the system

stack.

Sets I in the PS register. Interrupts are automatically disabled.

Fetches the corresponding interrupt vector value, then branches to the processing indicated by that

value.

A software interrupt request issued by the INT instruction has no interrupt request or enable flag. A

software interrupt request is always issued by executing the INT instruction.

The INT instruction does not have an interrupt level. Therefore, the INT instruction does not update ILM.

The INT instruction clears the I flag to suspend subsequent interrupt requests.

Structure of Software Interrupts

Software interrupts are handled within the CPU:

CPU.....Microcode: Interrupt processing step

List of Interrupt Vectors

"Table D-1 Interrupt Vectors" in APPENDIX D lists the interrupt vectors of the MB90360 series.

Software interrupts share the same interrupt vector area with hardware interrupts.

For example, interrupt request number INT 12 is used for external interrupt #0 to #7 of a hardware interrupt

as well as for INT #12 of a software interrupt. Therefore, external interrupt #0 and INT #12 call the same

interrupt processing routine.

Software Interrupt Operation

When the CPU fetches and executes the software interrupt instruction, the software interrupt processing

microcode is activated. The software interrupt processing microcode saves 12 bytes (PS, PC, PCB, DTB,

ADB, DPR, and A) to the memory area indicated by SSB and SSP. The microcode then fetches 3 bytes of

interrupt vector and loads them onto PC and PCB, resets the I flag, and sets the S flag. Then, the microcode

performs branch processing. As a result, the interrupt processing program defined by the user application

program is executed next.

Figure 3.6-1 illustrates the flow from the occurrence of a software interrupt until there is no interrupt

request in the interrupt processing program.