JPH0683640A - Interruption response processing system - Google Patents

Interruption response processing system

Info

Publication number
JPH0683640A
JPH0683640A JP23380292A JP23380292A JPH0683640A JP H0683640 A JPH0683640 A JP H0683640A JP 23380292 A JP23380292 A JP 23380292A JP 23380292 A JP23380292 A JP 23380292A JP H0683640 A JPH0683640 A JP H0683640A
Authority
JP
Japan
Prior art keywords
interrupt
bank
interruption
priority
cpu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP23380292A
Other languages
Japanese (ja)
Inventor
Takahide Nishiyama
隆英 西山
Yasuo Yamada
泰生 山田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP23380292A priority Critical patent/JPH0683640A/en
Publication of JPH0683640A publication Critical patent/JPH0683640A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To process an interruption response at a high speed by giving a system setting command in the one-word area of the head address of an interruption handler that is read out by an interruption request for execution of the interruption processing. CONSTITUTION:The information on a program counter (PC) 7a, a processor status word PSW 8a, a user stack printer USP, a previous bank pointer (PBP) 10, and general-purpose register are saved into a bank (RAM). An interruption controller (IRC) transfers the vector value assigned to an interruption permitting factor to a CPU 1 and calculates the head address of an interruption handler. The CPU 1 includes (16 bits X 3) pieces of core internal buses 12, and the vector value so far read by the CPU 1 as the 8-bit data is latched by a data register and latched with a 5-bit left shift. Thus the vector value is multiplied by 32 so that an area is secured for the interruption handler.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明は、特にシングルチップ
マイクロコンピュータで有効な割込処理開始までの高速
応答処理が可能な割込応答処理方式に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an interrupt response processing system capable of performing high-speed response processing until the start of interrupt processing, which is particularly effective in a single chip microcomputer.

【0002】[0002]

【従来の技術】シングルチップマイクロコンピュータ等
における処理過程において、例外事象による特定の要求
が発生すると、現在実行中の処理を中断して、他の処理
の実行を開始する。以下に、従来技術による他の処理を
開始するまでのシーケンスを説明する。
2. Description of the Related Art When a specific request due to an exceptional event occurs in a process of a single-chip microcomputer or the like, the process currently being executed is interrupted and another process is started. The sequence until the start of another process according to the related art will be described below.

【0003】従来技術では、例外事象による割込要求を
受付けると、現在処理しているルーチンの処理を中断
し、要求のあった割込処理のルーチンに移るが、しか
し、割込みの処理が終了すると、中断していた処理のル
ーチンに復帰し、その処理の続きを実行する必要がある
ので、割込み要求を受付けると、割込み発生直前のステ
ータスレジスタ(SR)・プログラムカウンタ(PC)
の退避を自動的に行う。その後に、例外ベクタテーブル
が参照され、例外ベクタテーブルに記載されたアドレス
値へ分岐して、順次的に割込処理を開始する。
In the prior art, when an interrupt request due to an exception event is accepted, the processing of the routine currently being processed is interrupted and the requested interrupt processing routine is entered, but when the interrupt processing is completed. , It is necessary to return to the interrupted processing routine and continue the processing. Therefore, when an interrupt request is accepted, the status register (SR) and program counter (PC) immediately before the interrupt occurred.
Will be automatically saved. After that, the exception vector table is referred to, the address value is branched to the address value described in the exception vector table, and interrupt processing is sequentially started.

【0004】割込処理は先ず、割込要因に相当するベク
タ値が生成される。生成されたベクタ値を使って、ベク
タテーブルのアドレス計算がなされる。アドレス計算に
よって生成されたアドレスによって、例外ベクタテーブ
ルが参照され、例外ベクタテーブルに記載された、割込
処理のルーチンの先頭アドレスを示すアドレス値が読出
される。
In the interrupt processing, first, a vector value corresponding to an interrupt factor is generated. A vector table address is calculated using the generated vector value. The exception vector table is referred to by the address generated by the address calculation, and the address value that is described in the exception vector table and indicates the start address of the interrupt processing routine is read.

【0005】そして、割込処理ルーチルで使用する各種
モードの設定は、この割込処理ルーチンの先頭で、プロ
グラムによって各種モードの設定を行っていた。例え
ば、バンクを切り換えたり、システムの切換えなどであ
る。実質的な割込処理の開始は各種モード設定を完了し
てからとなる。例えば、MC68000を一例に説明を
する。例外事象の割込みが発生したことを前提とし、図
5により説明する。
For setting various modes used in the interrupt processing routine, various modes are set by a program at the beginning of the interrupt processing routine. For example, switching banks or switching systems. Substantially, the start of the interrupt process comes after completing the various mode settings. For example, the MC68000 will be described as an example. It will be described with reference to FIG. 5 on the assumption that an interrupt of an exceptional event has occurred.

【0006】各割込要因には、割込み優先順位があり、
7つのレベルで存在する。中央演算処理装置(CPU)
への割込み要求は、割込要因の各優先順位を符号化され
て与えられる。
Each interrupt factor has an interrupt priority,
There are 7 levels. Central processing unit (CPU)
The interrupt request is given by encoding each priority of the interrupt factor.

【0007】図5(a) にステータスレジスタ(SR)の
ビット割付を示す。ステータスレジスタ(SR)の中
に、割込みマスク(3ビット)があり、その時点での優
先順位を示している。割込要因の優先順位が、割込みマ
スク(3ビット)の優先順位より高かった場合、割込み
の例外処理シーケンスが開始される。割込要因が受付け
られ、割込みの例外処理シーケンスが開始されたとす
る。
FIG. 5A shows the bit allocation of the status register (SR). There is an interrupt mask (3 bits) in the status register (SR), which indicates the priority order at that time. If the priority level of the interrupt factor is higher than the priority level of the interrupt mask (3 bits), the interrupt exception processing sequence is started. It is assumed that the interrupt factor is accepted and the interrupt exception processing sequence is started.

【0008】まずは、プログラムカウンタ(PC)の下
位ワードが、スタック(SSP)に退避され、ステータ
ス・レジスタ(SR)の内容は、一時的に格納される。
その後、ステータス・レジスタ(SR)のSビットをセ
ットし、特権ステートがスーパバイザステートに設定さ
れる。同時にTビットがリセットされ、例外処理ルーチ
ンの実行がトレース動作によって、妨害されないように
する。ステータスレジスタ(SR)を例外処理用に設定
後、各割込要因に割り付けられた同図(b) に示すベクタ
番号を、中央処理装置(CPU)が読み込む。
First, the lower word of the program counter (PC) is saved in the stack (SSP), and the contents of the status register (SR) are temporarily stored.
Then, the S bit of the status register (SR) is set, and the privileged state is set to the supervisor state. At the same time, the T bit is reset so that the execution of the exception handling routine is not disturbed by the trace operation. After setting the status register (SR) for exception processing, the central processing unit (CPU) reads the vector number shown in FIG. 9B assigned to each interrupt factor.

【0009】このベクタ番号を使って、例外ベクタを格
納している例外ベクタテーブル(2ワード)のアドレス
を同図(c) に示すように生成する。例外ベクタとは、例
外ベクタテーブル(2ワード)に格納されている例外を
処理するルーチンのメモリー・ロケーションのことであ
る。
Using this vector number, the address of the exception vector table (2 words) storing the exception vector is generated as shown in FIG. An exception vector is a memory location of a routine that handles exceptions stored in the exception vector table (2 words).

【0010】一時的に格納されたステータス・レジスタ
(SR)とプログラムカウンタ(PC)の上位が、スタ
ック(SSP)に退避される。そして、生成された例外
ベクタテーブル(2ワード)のアドレスを使って、例外
ベクタを参照する。新しいプログラムカウンタ(PC)
値が、同図(d) に示すように、例外ベクタから読み込ま
れ、実際の割込要因の例外処理が開始される。
The higher-order status register (SR) and program counter (PC) temporarily stored are saved in the stack (SSP). Then, the exception vector is referenced using the address of the generated exception vector table (2 words). New program counter (PC)
The value is read from the exception vector as shown in (d) of the figure, and the exception processing for the actual interrupt factor is started.

【0011】以上のように、各割込要因に相当するベク
タ値を、中央処理装置(CPU)は読み込み、そのベク
タ値を使って、例外ベクタテーブルのアドレス計算をす
る。そして、例外ベクタテーブルの例外ベクタを参照し
て、その例外ベクタの示す値が、実際の割込処理を開始
する先頭アドレスとなる。これでは一度、例外ベクタを
参照することで、割込みを受付けてから、実際の割込処
理を開始するまでの応答時間が遅くなってしまう。また
別の例として、TLCS−900の割込み発生について
説明する。
As described above, the central processing unit (CPU) reads the vector value corresponding to each interrupt factor, and uses the vector value to calculate the address of the exception vector table. Then, by referring to the exception vector in the exception vector table, the value indicated by the exception vector becomes the start address for starting the actual interrupt processing. In this case, by referring to the exception vector once, the response time from the acceptance of the interrupt to the start of the actual interrupt processing will be delayed. As another example, the occurrence of an TLCS-900 interrupt will be described.

【0012】前例と同様に、各割込要因に対して優先順
位が割り付けられており、優先順位に従って割込要因を
受付ける。図5(e) にステータスレジスタ(SR)のビ
ット割付を示す。
Similar to the previous example, the priority is assigned to each interrupt factor, and the interrupt factor is accepted according to the priority. Figure 5 (e) shows the bit allocation of the status register (SR).

【0013】発生した割込みの優先順位と、ステータス
レジスタ(SR)の割込みマスクの比較により、発生し
た割込みの優先順位の方が、レベルが高いときに、割込
みが許可され、受付けられたことになる。割込みが受付
けられると、中央処理装置(CPU)は、割込みコント
ローラから割込みベクタを読み込む。
By comparing the priority of the generated interrupt with the interrupt mask of the status register (SR), when the priority of the generated interrupt is higher, it means that the interrupt is permitted and accepted. . When the interrupt is accepted, the central processing unit (CPU) reads the interrupt vector from the interrupt controller.

【0014】中央処理装置(CPU)は、プログラムカ
ウンタ(PC)とステータスレジスタ(SR)を、シス
テム側のスタックに退避する。ステータスレジスタ(S
R)の割込みマスク(IFF2〜0)に、受付けた割込
みの優先順位を、インクリメント「+1」した値をセッ
トする。ステータスレジスタ(SR)のシステムモード
(SYSM)を、セットして、システムモードに移行す
る。そして、中央処理装置(CPU)は、読み込んだ割
込みベクタ値を使って、割込処理ルーチンの先頭アドレ
スを計算する。先頭アドレスを生成後、割込処理ルーチ
ンの実行を開始する。
The central processing unit (CPU) saves the program counter (PC) and status register (SR) in the stack on the system side. Status register (S
In the R) interrupt mask (IFF2 to 0), the priority of the accepted interrupt is incremented by "+1" and set to a value. The system mode (SYSM) of the status register (SR) is set to shift to the system mode. Then, the central processing unit (CPU) calculates the start address of the interrupt processing routine using the read interrupt vector value. After the start address is generated, the execution of the interrupt processing routine is started.

【0015】以上のように、割込みが許可されて、中央
処理装置(CPU)が割込みコントローラから割込みベ
クタを読み込んで、プログラムカウンタ(PC)とステ
ータスレジスタ(SR)をシステム側のスタックに退避
する。そして、割込みベクタを使って、割込処理ルーチ
ンの先頭アドレスを計算し割込処理ルーチンへ、分岐す
るものである。
As described above, the interrupt is permitted, the central processing unit (CPU) reads the interrupt vector from the interrupt controller, and saves the program counter (PC) and the status register (SR) in the stack on the system side. Then, the interrupt vector is used to calculate the start address of the interrupt processing routine and branch to the interrupt processing routine.

【0016】この構成では、割込みを受付けてから割込
処理ルーチンを開始するまでは、高速な処理であるが、
各種モードを設定して割込要因に対する割込処理を実行
するには、割込処理ルーチルが開始されてから、プログ
ラムによって、バンクを切り換えたり、各種モード設定
を行うことになり、割込みを受付けてから、実際の割込
処理を開始するまでの応答時間が遅くなってしまう。
With this configuration, the processing from the acceptance of the interrupt to the start of the interrupt processing routine is fast,
To set the various modes and execute the interrupt processing for the interrupt factor, after the interrupt processing routine is started, the bank will be switched and the various modes will be set by the program. Therefore, the response time until the actual interrupt processing is started becomes slow.

【0017】[0017]

【発明が解決しようとする課題】前述した例のように、
生成されたベクタ値によって、ベクタテーブルが参照さ
れ、ベクタテーブルに記載されたアドレス値を割込処理
のルーチンの先頭アドレスに読出して、割込処理を開始
するまでに、割込処理で使用するシステムのモードを切
換えたり、カレントバンクを切換える等の処理およびプ
ログラムカウンタ(PC)、ステータスレジスタ(S
R)を退避させる必要がある。
DISCLOSURE OF THE INVENTION As in the example described above,
A system used by the interrupt process by referring to the vector table with the generated vector value, reading the address value described in the vector table to the start address of the interrupt process routine, and starting the interrupt process. Processing such as switching the mode of the memory, switching the current bank, etc., the program counter (PC), the status register (S
R) needs to be saved.

【0018】従来技術では、これらの処理や退避を行っ
た後で、ベクタ値を使って割込処理のルーチンの先頭ア
ドレスを計算しており、順次的な流れであった。従っ
て、例外事象による割込みの発生から実際の割込処理ル
ーチンを実行するまでの応答時間が遅く、高速な割込応
答が出来ない問題があった。
In the prior art, after performing these processes and saving, the start address of the interrupt process routine is calculated using the vector value, which is a sequential flow. Therefore, there is a problem that the response time from the occurrence of an interrupt due to an exception event to the execution of the actual interrupt processing routine is slow, and a high-speed interrupt response cannot be performed.

【0019】この発明は、このような問題を解決するた
めになされたもので、割込要求受付後、高速な応答処理
が可能で、しかも、各種割込みモード等の設定自由度が
大きい割込応答処理方式を提供することを目的としてい
る。
The present invention has been made in order to solve such a problem, and is capable of high-speed response processing after acceptance of an interrupt request and having a high degree of freedom in setting various interrupt modes and the like. The purpose is to provide a processing method.

【0020】[0020]

【課題を解決するための手段】この発明の割込応答処理
方式は、割込み要求の発生により読出される割込ハンド
ラの先頭番地の少なくとも1ワード領域に、割込み処理
のためのシステム設定コマンドを設けたことを特徴とし
ている。
According to the interrupt response processing method of the present invention, a system setting command for interrupt processing is provided in at least one word area of the head address of an interrupt handler read when an interrupt request occurs. It is characterized by that.

【0021】[0021]

【作用】このように構成することにより、PC,PSW
等のステータス情報を退避させながら、割込み先の番地
を計算して割込み処理の実行に入るので、高速の割込応
答処理が可能になる。
[Function] By configuring in this way, PC, PSW
Since the address of the interrupt destination is calculated and the interrupt process is started while saving the status information such as "etc.", high-speed interrupt response process becomes possible.

【0022】[0022]

【実施例】以下、図面を参照しながらこの発明の一実施
例を説明する。図1は、この発明の一実施例のシステム
構成を示すブロック構成図であり、図2は、中央処理装
置(CPU)の内部構成を示すブロック構成図である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a block configuration diagram showing a system configuration of an embodiment of the present invention, and FIG. 2 is a block configuration diagram showing an internal configuration of a central processing unit (CPU).

【0023】図1において、1は中央処理装置(CP
U)で、2はバンク(RAM)、3は割込みコントロー
ラ(IRC)、4は周辺デバイス(I/O)、5はこれ
らを結ぶメインシステムバス(MBUS)である。ま
た、中央処理装置(CPU)1とバンク(RAM)2は
専用バス6で接続されている。
In FIG. 1, reference numeral 1 is a central processing unit (CP).
U), 2 is a bank (RAM), 3 is an interrupt controller (IRC), 4 is a peripheral device (I / O), and 5 is a main system bus (MBUS) connecting them. The central processing unit (CPU) 1 and the bank (RAM) 2 are connected by a dedicated bus 6.

【0024】割込みコントローラ(IRC)3は同図に
示すように、周辺デバイス4から割込要求信号を受け、
中央処理装置(CPU)1に割込発生信号を送るととも
に割込み処理が可能であれば割込受付信号を受けるよう
になっている。
The interrupt controller (IRC) 3 receives an interrupt request signal from the peripheral device 4 as shown in FIG.
An interrupt generation signal is sent to the central processing unit (CPU) 1 and an interrupt acceptance signal is received if interrupt processing is possible.

【0025】また、中央処理装置(CPU)1の内部
は、図2に示すように、バスインタフェース部7,算術
論理演算部(ALU)8,図4(a) に詳細構造を示すレ
ジスタファイル9,一つ前に使用したレジスタバンクの
番号を示すプレビアスバンクポインタ(PBP)10お
よび現在のレジスタバンクの番号を示すカレントバンク
ポインタ(CBP)11が設けられており、コア内部バ
ス(IBUS)12により相互に接続されている。
As shown in FIG. 2, the inside of the central processing unit (CPU) 1 is a bus interface unit 7, an arithmetic logic unit (ALU) 8, and a register file 9 whose detailed structure is shown in FIG. 4A. , A previous bank pointer (PBP) 10 indicating the number of the register bank used immediately before and a current bank pointer (CBP) 11 indicating the current register bank number are provided, and the core internal bus (IBUS) 12 is provided. Are connected to each other by.

【0026】さらに、バスインタフェース部7にはプロ
グラムカウンタ(PC)7aが、算術論理演算部(AL
U)8にはプロセサステータスワード(PSW)8aが
設けられている。また、レジスタファイル9は専用バス
6によりバンク(RAM)2と接続されている。図3
(a) 〜(h) は、この実施例の動作を説明するためのコマ
ンド構成の説明図である。
Further, the bus interface unit 7 has a program counter (PC) 7a and an arithmetic logic unit (AL).
U) 8 is provided with a processor status word (PSW) 8a. The register file 9 is connected to the bank (RAM) 2 by a dedicated bus 6. Figure 3
(a) ~ (h) is an explanatory diagram of a command configuration for explaining the operation of this embodiment.

【0027】また、図4(a)(b)は、レジスタファイル9
の詳細構造と例外事象に対する割込処理のため処理中の
情報をバンク(RAM)2の中に退避させる場合の一例
を説明する説明図である。
Further, FIGS. 4A and 4B show the register file 9
FIG. 3 is an explanatory diagram illustrating an example of a case where the information being processed for the interrupt processing for the detailed event and the exception event is saved in the bank (RAM) 2.

【0028】同図(a) において、レジスタファイル9内
はレジスタ群で構成され、9aはユーザスタックポイン
タ(USP),9bはインタラプトスタックポインタ
(ISP),9cはエミュレータスタックポインタ(E
SP)であり、R0〜R15は汎用レジスタである。こ
のような構成になるシステムにおいて、この実施例の例
外事象に対する割込応答処理方式を図1,図2,図3お
よび図4により説明する。
In FIG. 1A, the register file 9 is composed of registers, 9a is a user stack pointer (USP), 9b is an interrupt stack pointer (ISP), and 9c is an emulator stack pointer (E).
SP) and R0 to R15 are general-purpose registers. In the system having such a configuration, an interrupt response processing method for an exceptional event of this embodiment will be described with reference to FIGS. 1, 2, 3 and 4.

【0029】例外事象とは、その発生に応答してシング
ルチップマイクロコンピュータの通常の動作の流れを、
変更するよく知られた方法である。例外事象には内部的
要因により発生するものと、外部的要因により発生する
ものとがある。
An exceptional event is a normal operation flow of a single-chip microcomputer in response to the occurrence.
This is a well-known method of changing. Exceptional events include those generated by internal factors and those generated by external factors.

【0030】例えば内部的要因により発生するものに、
プログラム実行中に、正しいビットパターンと異なるビ
ットパターンの命令をフェッチすると、割込みが発生す
る未定義命令違反、システムを保護する目的で各種の命
令が特権化されており、特権命令の1つをユーザモード
で使用したときに割込みが発生する特権命令違反などが
ある。
For example, for those generated by internal factors,
When an instruction with a bit pattern different from the correct bit pattern is fetched during program execution, an undefined instruction violation occurs, and various instructions are privileged for the purpose of protecting the system. There is a privileged instruction violation that causes an interrupt when used in mode.

【0031】外部的要因により発生するものに、リセッ
ト、周辺デバイスからの割込みなどがある。同時に複数
の例外事象が発生した場合は、各要因に割付けられた優
先順位の関係によって決定され、発生させられる。
Resets, interrupts from peripheral devices, etc. are generated by external factors. When a plurality of exception events occur at the same time, they are determined and caused by the priority relationship assigned to each factor.

【0032】これから説明する例外事象の例は、外部的
要因により発生する周辺デバイスからの割込みについて
であり、同時に複数の例外事象が発生したときに、その
中で一番割込みの優先順位の高い割込み要因を、受付け
たことを前提とする。これから説明する中で現れる、技
術用語について予め定義しておく。
An example of the exception event to be described below is an interrupt from a peripheral device which is generated by an external factor. When a plurality of exception events occur simultaneously, the interrupt having the highest priority among them is the interrupt. It is assumed that the factors have been accepted. The technical terms that will appear in the explanation below will be defined in advance.

【0033】割込発生信号(INT)とは、周辺デバイ
スからの割込要求には、それぞれに割り付けられた優先
順位があり、割込コントローラ(IRC)3が優先順位
を認識して、中央演算処理装置(CPU)1へ、割込み
が発生したことを知らせる信号のことである。
The interrupt generation signal (INT) means that the interrupt request from the peripheral device has a priority order assigned to each, and the interrupt controller (IRC) 3 recognizes the priority order and performs a central operation. This is a signal that notifies the processing device (CPU) 1 that an interrupt has occurred.

【0034】割込受け信号(INTACK)とは、中央
演算処理装置(CPU)1が割込要因の優先順位と割込
みを許可する判別要素の状態によって、割込みを受付け
ることを判断し、割込みが受付けられたことにより、割
込みコントローラ(IRC)に割込みを受付けたこと
を、知らせる信号のことである。
The interrupt acceptance signal (INTACK) means that the central processing unit (CPU) 1 decides to accept the interrupt depending on the priority of the interrupt factor and the state of the discrimination element for permitting the interrupt, and the interruption is accepted. This is a signal notifying that the interrupt has been accepted by the interrupt controller (IRC).

【0035】割込処理応答時間とは、割込要求を受付け
てから(中央演算処理装置(CPU)1が割込受付信号
(INTACK)を割込コントローラ(IRC)3に出
力してから)EITモードを実行後、実際の割込み要因
に対する処理が開始されるまでの時間のことである。
The interrupt processing response time is the EIT after the interrupt request is accepted (after the central processing unit (CPU) 1 outputs an interrupt acceptance signal (INTACK) to the interrupt controller (IRC) 3). This is the time from when the mode is executed until the processing for the actual interrupt factor is started.

【0036】割込応答バスサイクル(IABC)とは、
中央演算処理装置(CPU)1が割込受付信号(INT
ACK)を割込コントローラ(IRC)3に出力してか
ら中央演算処理装置(CPU)1がベクタ値を割込みコ
ントローラ(IRC)3から読み込むまでのサイクルの
ことである。割込ハンドラとは、EITモードを解釈し
て、割込み要因に対する処理を実行し、完了するまでの
ルーチンのことである。割込ハンドラルーチンとは、E
ITモードの実行を行い、モード設定がなされた後か
ら、実際の割込要因に対する処理のことである。専用バ
ス6とは、割込みによる情報の退避/復帰時にレジスタ
ファイル9とバンク(RAM)2のインタフェースをと
る64bit幅のバスのことである。
The interrupt response bus cycle (IABC) is
The central processing unit (CPU) 1 receives an interrupt acceptance signal (INT
It is a cycle from the output of (ACK) to the interrupt controller (IRC) 3 until the central processing unit (CPU) 1 reads the vector value from the interrupt controller (IRC) 3. The interrupt handler is a routine that interprets the EIT mode, executes processing for an interrupt factor, and completes the processing. The interrupt handler routine is E
This is a process for an actual interrupt factor after the IT mode is executed and the mode is set. The dedicated bus 6 is a 64-bit wide bus that interfaces the register file 9 and the bank (RAM) 2 at the time of saving / restoring information by an interrupt.

【0037】EITモードとは、割込ハンドラの先頭番
地に、少なくとも1ワード分の領域を設けられた、各種
モード(バンク切換え、使用レジスタ数など)の設定を
行うためのコマンドである。周辺デバイス4からの割込
要求により、所定のシーケンスによる割込処理を開始す
る。これから割込処理の開始までのシーケンスについて
説明する。
The EIT mode is a command for setting various modes (bank switching, number of registers used, etc.) in which an area for at least one word is provided at the head address of the interrupt handler. In response to an interrupt request from the peripheral device 4, the interrupt process according to a predetermined sequence is started. The sequence from this to the start of the interrupt process will be described.

【0038】周辺デバイス4が、ある要因により割込要
求信号(INTREQ)を発生することで、所定のシー
ケンスが開始され、割込みの制御を行う割込みコントロ
ーラ(IRC)3に、周辺デバイス4は割込要求信号
(INTREQ)を送信する。前述したように例外事象
には、各要因に対して優先順位が割付けられている。割
込みコントローラ(IRC)3は、周辺デバイスからの
割込要求信号(INTREQ)により、その割込要因の
優先順位を認識する。優先順位を認識後、割込みコント
ローラ(IRC)3は、割込みが発生したことを知らせ
る割込発生信号(INT)を、中央演算処理装置(CP
U)1へ出力する。
When the peripheral device 4 generates an interrupt request signal (INTREQ) due to a certain factor, a predetermined sequence is started, and the peripheral device 4 interrupts the interrupt controller (IRC) 3 that controls interrupts. A request signal (INTREQ) is transmitted. As described above, the priority is assigned to each factor in the exceptional event. The interrupt controller (IRC) 3 recognizes the priority of the interrupt factor by the interrupt request signal (INTREQ) from the peripheral device. After recognizing the priority, the interrupt controller (IRC) 3 sends an interrupt generation signal (INT) indicating that an interrupt has occurred to the central processing unit (CP).
U) Output to 1.

【0039】割込みコントローラ(IRC)3からの割
込発生信号(INT)に対して、中央演算処理装置(C
PU)1は、割込要因の優先順位と割込みを許可する判
別要素の状態によって、割込みを受付けることを判断す
る。判別要素として図3(a)に示すような、プロセサス
テータスワード(PSW)8aの割込み許可フラグ(E
I)や割込みマスク(IM)がある。
In response to the interrupt generation signal (INT) from the interrupt controller (IRC) 3, the central processing unit (C
The PU) 1 determines whether to accept the interrupt based on the priority of the interrupt factor and the state of the determination element that permits the interrupt. As a discrimination element, as shown in FIG. 3A, the interrupt enable flag (E) of the processor status word (PSW) 8a is used.
I) and interrupt mask (IM).

【0040】なお同図において、C,V,N,Zはコン
ディションコードで、TMはタスクを指定するためのタ
スクモード、BSはバンクサイズ、DIは遅延割込の指
定、RGは特権モード指定、SSはシングルステップ動
作の指定である。
In the figure, C, V, N and Z are condition codes, TM is a task mode for designating a task, BS is a bank size, DI is a delay interrupt designation, and RG is a privilege mode designation. SS is the designation of single step operation.

【0041】EIフラグにより、マスカブルな割込みに
対して、イネーブル状態であれば割込みを許可する。例
外事象には前述したように、各要因に対して優先順位が
割付けられている。IMフラグの状態と比べて、発生し
た割込み要因の優先順位の方が高い時に割込みを受付け
ることができる。
The maskable interrupt is permitted by the EI flag if the maskable interrupt is enabled. As described above, priority is assigned to each factor for the exceptional event. The interrupt can be accepted when the priority of the generated interrupt factor is higher than that of the state of the IM flag.

【0042】優先順位の一例として、IMフラグをPS
Wの中で3ビット設け、優先順位数として7段(7レベ
ル)を設けたとする。IMフラグに2をセットした時に
優先順位2を表す。優先順位の示す値が大きい程、優先
順位は高いことになる。発生した割込要因が優先順位5
のときに、IMフラグが2をセットされていたとき、発
生した割込要因の方が優先順位が高いので割込みを受付
けられることになる。そして、IMフラグに受付けた割
込みの優先順位を1レベルあげた値をセットする。ここ
ではIMフラグを6にセットする。
As an example of the priority order, the IM flag is set to PS.
It is assumed that 3 bits are provided in W and 7 steps (7 levels) are provided as the number of priorities. When the IM flag is set to 2, it indicates a priority level of 2. The larger the value indicated by the priority, the higher the priority. The interrupt factor that occurred is priority 5
At this time, when the IM flag is set to 2, the interrupt factor that has occurred has a higher priority, so the interrupt can be accepted. Then, the IM flag is set to a value obtained by raising the priority of the accepted interrupt by one level. Here, the IM flag is set to 6.

【0043】割込み優先順位が個々に割付けられなくな
る程割込要因数が増えてくると、PSWのIMフラグを
3ビットから4、5ビットに拡張したり、同一優先順位
の中で、さらに優先順位を割り当てるようにすれば、割
込み要因数が増えても対応可能となる。
When the number of interrupt factors increases so that the interrupt priorities cannot be individually assigned, the IM flag of the PSW is expanded from 3 bits to 4 or 5 bits, or the priority is further increased in the same priority. By assigning, it is possible to deal with the increase in the number of interrupt factors.

【0044】割込許可状態で、割込要因の優先順位が、
IMフラグの示す優先順位より高いことで、割込みが受
付けられると、中央処理装置(CPU)1が、割込みコ
ントローラ(IRC)3に割込みが発生し受付けられた
ことを知らせる割込受付信号(INTACK)を出力
し、割込受付信号(INTACK)により割込応答バス
サイクルを開始する。
In the interrupt enabled state, the priority of the interrupt factor is
When the interrupt is accepted because the priority is higher than that indicated by the IM flag, the central processing unit (CPU) 1 informs the interrupt controller (IRC) 3 that the interrupt is generated and accepted (INTACK). Is output, and the interrupt response bus cycle is started by the interrupt acceptance signal (INTACK).

【0045】それと同時に、プログラムカウンタ(P
C)7a、プロセサステータスワード(PSW)8a、
ユーザスタックポインタ(USP)9a、プレビアスバ
ンクポインタ(PBP)10および汎用レジスタR0〜
R15内の情報を、メインシステムバス(MBUS)5
を介さずに専用バス6を経由してバンク(RAM)2に
退避させる動作を行う。このことについては、後述する
ことにする。
At the same time, the program counter (P
C) 7a, processor status word (PSW) 8a,
User stack pointer (USP) 9a, pre-deposit bank pointer (PBP) 10 and general-purpose registers R0-
Information in R15 is transferred to main system bus (MBUS) 5
The operation of saving the data in the bank (RAM) 2 via the dedicated bus 6 is performed without passing through. This will be described later.

【0046】割込みコントローラ(IRC)3は、割込
受付信号(INTACK)を受付けると、割込み許可さ
れた要因に割当てられたベクタ値を、メインシステムバ
ス(MBUS)5に出力し、ベクタ値を中央処理装置
(CPU)1に転送する。図3(b) に、ベクタ値のフォ
ーマットを示す。
When the interrupt controller (IRC) 3 receives the interrupt acceptance signal (INTACK), it outputs the vector value assigned to the interrupt-enabled factor to the main system bus (MBUS) 5 and outputs the vector value to the center. Transfer to the processing device (CPU) 1. Figure 3 (b) shows the format of vector values.

【0047】但し、この実施例においては、割込みの各
要因に割当てられたベクタ値は、連続なる数値がそれぞ
れの割込要因に割り当てられた場合とする。その他の場
合については後述する。
However, in this embodiment, it is assumed that the vector values assigned to each factor of interrupts are such that consecutive numerical values are assigned to each interrupt factor. Other cases will be described later.

【0048】中央処理装置(CPU)1に転送されてき
たベクタ値を使って割込ハンドラのある先頭番地をアド
レス計算する。実際にアドレス計算の手順として、中央
処理装置(CPU)1のバスインタフェース部(BI
U)7を使って計算する。
The vector value transferred to the central processing unit (CPU) 1 is used to calculate the address of the head address where the interrupt handler is located. As an actual address calculation procedure, the bus interface (BI) of the central processing unit (CPU) 1 is used.
U) Calculate using 7.

【0049】シングルチップマイクロコンピュータの、
内部に存在するメインシステムバス(MBUS)5を経
由して、転送されたベクタ値は、バスインタフェース部
(BIU)7内のデータレジスタにラッチされる。
Of a single-chip microcomputer,
The vector value transferred via the internal main system bus (MBUS) 5 is latched in the data register in the bus interface unit (BIU) 7.

【0050】中央処理装置(CPU)1の内部には、1
6ビット×3本構成のコア内部バス(IBUS)12が
存在する。8ビットデータとして中央処理装置(CP
U)1にリードされてきたベクタ値は、データレジスタ
にラッチされる。次に、ベクタ値は、コア内部バス(I
BUS)12を経由して、バスインタフェース部(BI
U)7内のアドレスレジスタにラッチされる。
Inside the central processing unit (CPU) 1, 1
There is a core internal bus (IBUS) 12 of 6 bits × 3 lines. Central processing unit (CP
U) The vector value read into 1 is latched in the data register. The vector value is then transferred to the core internal bus (I
Bus interface unit (BI)
U) Latched in the address register in 7.

【0051】アドレスレジスタにラッチされるときに
は、5ビット左シフトさせてラッチされる。左に5ビッ
トシフトさせることにより、リードされてきたベクタ値
を32倍にしたことになる。32倍することで割込ハン
ドラの領域を確保したことになり、1つの割込ハンドラ
あたり16ワード分に相当する。
When it is latched in the address register, it is left shifted by 5 bits and latched. By shifting to the left by 5 bits, the read vector value is multiplied by 32. By multiplying by 32, the area of the interrupt handler is secured, and one interrupt handler corresponds to 16 words.

【0052】16ワード必要ない場合には、5ビットシ
フトしないで4あるいは、3ビットシフトさせれば8あ
るいは4ワードとエリアを削減でき、限られた領域の中
で、16ワードの場合より、数多くの割込要因に対応可
能になる。ここで理解し易くするため、数式により割込
ハンドラ先頭番地の計算方法を表すことにする。それは
下記の通りとなる。 INTha=Vec×32+VecBase INTha … 割込ハンドラ先頭番地 Vec … ベクタ値 VecBase… ROMの先頭番地 アドレスレジスタにラッチされた値に、ROMの先頭番
地(VecBase)を加えることで割込ハンドラ先頭
番地となる。
When 16 words are not required, it is possible to reduce the area by 8 or 4 words by shifting 4 or 3 bits without shifting 5 bits. It becomes possible to deal with the interrupt factor of. For ease of understanding, the method of calculating the start address of the interrupt handler will be represented by a mathematical expression. It is as follows. INTha = Vec × 32 + VecBase INTha ... Interrupt handler start address Vec ... Vector value VecBase ... ROM start address The start address of the interrupt handler is added by adding the start address (VecBase) of the ROM to the value latched in the address register.

【0053】例えば、ROMの先頭番地(VecBas
e)を8000Hに割付けたとすると、図3(c) に示す
ように、15ビット目に1をセットして14・13ビッ
ト目は0をセットし、残り12〜0ビットはベクタ値を
左5ビットシフトした値となる。以上で割込ハンドラの
先頭番地(INTha)が生成されたことになる。
For example, the start address of the ROM (VecBas
Assuming that e) is assigned to 8000H, as shown in Fig. 3 (c), 1 is set in the 15th bit, 0 is set in the 14th and 13th bits, and the remaining 12 to 0 bits are vector values to the left. The value is bit-shifted. With the above, the start address (INTha) of the interrupt handler is generated.

【0054】このように割込みの発生により、割込ハン
ドラ先頭番地(INTha)のアドレス計算を実行しな
がら、プログラムカウンタ(PC)7a、プロセサステ
ータスワード(PSW)8a、ユーザスタックポインタ
(USP)9a、プレビアスバンクポインタ(PBP)
10および、汎用レジスタ(R0〜R15)の情報をメ
インシステムバス(MBUS)5介さずに、専用バス6
を経由して退避を行うものである。この割込みの発生に
よる情報の退避について説明をする。
As described above, when an interrupt is generated, the address of the start address (INTha) of the interrupt handler is calculated, while the program counter (PC) 7a, the processor status word (PSW) 8a, the user stack pointer (USP) 9a, Pleasure Bank Pointer (PBP)
10 and information of general-purpose registers (R0 to R15) without passing through the main system bus (MBUS) 5;
The evacuation is done via. The saving of information due to the occurrence of this interrupt will be described.

【0055】中央処理装置(CPU)1は、割込受付信
号(INTACK)を割込みコントローラ(IRC)3
に出力すると、割込みコントローラ(IRC)3からベ
クタ値を読み込み、割込ハンドラのアドレス計算を実行
しながら、情報の退避の動作を行う。
The central processing unit (CPU) 1 sends an interrupt acceptance signal (INTACK) to the interrupt controller (IRC) 3
Then, the vector value is read from the interrupt controller (IRC) 3, and the address saving operation is performed while executing the address calculation of the interrupt handler.

【0056】退避の手順について説明をする。退避する
情報として、プログラムカウンタ(PC)7a、プロセ
サステータスワード(PSW)8a、図4(a) に示す、
ユーザスタックポインタ(USP)9a、プレビアスバ
ンクポインタ(PBP)10および汎用レジスタR0〜
R15の情報の5項目を専用バス6を使用して退避す
る。専用バスの構成は64ビット幅構成で、論理的に1
6ビット×4レジスタの情報を転送可能である。
The procedure of saving will be described. As the information to be saved, a program counter (PC) 7a, a processor status word (PSW) 8a, shown in FIG.
User stack pointer (USP) 9a, pre-deposit bank pointer (PBP) 10 and general-purpose registers R0-
The five items of information in R15 are saved using the dedicated bus 6. The dedicated bus has a 64-bit width and is logically 1
Information of 6 bits × 4 registers can be transferred.

【0057】各レジスタの構成は、汎用レジスタR0〜
R15の各レジスタが16ビット、プログラムカウンタ
(PC)7aが24ビット、プロセサステータスワード
(PSW)8aが16ビット、ユーザスタックポインタ
(USP)9aが16ビットで、プレビアスバンクポイ
ンタ(PBP)10が8ビットであり、転送の組み合わ
せとしてプログラムカウンタ(PC)7a、プロセサス
テータスワード(PSW)8a、ユーザスタックポイン
タ(USP)9a、プレビアスバンクポインタ(PB
P)10を1組とし、汎用レジスタR0〜R15を4レ
ジスタ1組とする4組の固まりとし、計5組の組み合わ
せで情報を退避する。
The structure of each register is as follows.
Each register of R15 is 16 bits, the program counter (PC) 7a is 24 bits, the processor status word (PSW) 8a is 16 bits, the user stack pointer (USP) 9a is 16 bits, and the previa bank pointer (PBP) 10 is It is 8 bits, and as a combination of transfer, a program counter (PC) 7a, a processor status word (PSW) 8a, a user stack pointer (USP) 9a, and a pre-bank bank pointer (PB).
P) 10 is set as one set, and general-purpose registers R0 to R15 are set as 4 sets of 4 sets, and a total of 5 sets are used to save information.

【0058】5組の組み合わせの情報は、カレントバン
クポインタ(CBP)11の示す値のバンク番号に退避
させるもので、割込み受付と同時に退避動作が開始され
る。最初に退避されるのが汎用レジスタR0〜R15の
情報である。
The information of the five sets of combinations is saved in the bank number of the value indicated by the current bank pointer (CBP) 11, and the saving operation is started at the same time when the interrupt is accepted. The information saved in the general-purpose registers R0 to R15 is saved first.

【0059】レジスタファイル9内にあるレジスタは、
汎用レジスタR0〜R15、ユーザスタックポインタ
(USP)9a、インタラプトスタックポインタ(IS
P)9b、エミュレータスタックポインタ(ESP)9
cであり、退避する必要のある残りの情報であるプログ
ラムカウンタ(PC)7a、プロセサステータスワード
(PSW)8aおよびプレビアスバンクポインタ(PB
P)10の情報については、退避するためにコア内部バ
ス(IBUS)6を使ってレジスタファイル9に転送す
る必要がある。
The registers in the register file 9 are
General-purpose registers R0 to R15, user stack pointer (USP) 9a, interrupt stack pointer (IS
P) 9b, emulator stack pointer (ESP) 9
c, which is the remaining information that needs to be saved, that is, the program counter (PC) 7a, the processor status word (PSW) 8a, and the previous bank pointer (PB).
The information of P) 10 needs to be transferred to the register file 9 using the core internal bus (IBUS) 6 in order to save it.

【0060】このプログラムカウンタ(PC)7a、プ
ロセサステータスワード(PSW)8a、プレビアスバ
ンクポインタ(PBP)10が転送されてくる間に、汎
用レジスタR0〜R15の情報をバンク(RAM)2に
退避させる。転送されてきたプログラムカウンタ(P
C)7a、プロセサステータスワード(PSW)8a、
プレビアスバンクポインタ(PBP)10の情報は、と
りあえず、汎用レジスタR0〜R15のすでに退避済み
のレジスタ群に一時記憶させる。
While the program counter (PC) 7a, the processor status word (PSW) 8a, and the pre-presence bank pointer (PBP) 10 are transferred, the information in the general-purpose registers R0 to R15 is saved in the bank (RAM) 2. Let The transferred program counter (P
C) 7a, processor status word (PSW) 8a,
The information of the Pre-Bank bank pointer (PBP) 10 is temporarily stored in the already saved register group of the general-purpose registers R0 to R15 for the time being.

【0061】一例として、汎用レジスタのレジスタ番号
の大きい方から退避したとする。最初に退避されるレジ
スタ群は、R15〜R12となり、転送されてきたプロ
グラムカウンタ(PC)7a、プロセサステータスワー
ド(PSW)8a、プレビアスバンクポインタ(PB
P)10の情報を、このレジスタ群R15〜R12に退
避させる。
As an example, it is assumed that the general register is saved from the larger register number. The registers saved first are R15 to R12, and the transferred program counter (PC) 7a, processor status word (PSW) 8a, and pre-via bank pointer (PB).
The information of P) 10 is saved in the register groups R15 to R12.

【0062】汎用レジスタR12にはプログラムカウン
タ(PC)7aの下位16ビットを転送し、R13の上
位8ビットにプレビアスバンクポインタ(PBP)1
0、下位8ビットにプログラムカウンタ(PC)7aの
上位8ビットを転送する。またR14にはユーザスタッ
クポインタ(USP)9aを転送し、R15にはプロセ
サステータワード(PSW)8aを転送する。
The lower 16 bits of the program counter (PC) 7a are transferred to the general-purpose register R12, and the preceding bank pointer (PBP) 1 is transferred to the upper 8 bits of R13.
The upper 8 bits of the program counter (PC) 7a are transferred to 0 and the lower 8 bits. The user stack pointer (USP) 9a is transferred to R14, and the processor status word (PSW) 8a is transferred to R15.

【0063】1バンクの大きさは、4ワード分に相当す
る。カレントバンクポインタ(CBP)11の示す値の
バンク番号は、プログラムカウンタ(PC)7a、プロ
セサステータスワード(PSW)8a、ユーザスタック
ポインタ(USP)9a、プレビアスバンクポインタ
(PBP)10を退避させるバンクとして使い、汎用レ
ジスタR0〜R15はカレントポインタ(CBP)11
の示す値に+1〜+4を加えたバンク番号のバンク(R
AM)2の中のバンクに退避させる。
The size of one bank corresponds to four words. The bank number of the value indicated by the current bank pointer (CBP) 11 is a bank for saving the program counter (PC) 7a, processor status word (PSW) 8a, user stack pointer (USP) 9a, and pre-via bank pointer (PBP) 10. The general purpose registers R0 to R15 are used as the current pointer (CBP) 11
Of the bank number (R to +1 to +4 added to the value
AM) 2) to the bank.

【0064】一例として、カレントバンクポインタ(C
BP)11の値が15のときに、退避する情報が、バン
ク(RAM)2の中のどこのバンクに退避させるかを、
図4(b) に示す。
As an example, the current bank pointer (C
When the value of the BP) 11 is 15, the bank to which the information to be saved is saved in the bank (RAM) 2
It is shown in Fig. 4 (b).

【0065】バンク(RAM)2のバンク15に、プロ
グラムカウンタ(PC)7a、プロセサステータスワー
ド(PSW)8a、ユーザスタックポインタ(USP)
9aおよびプレビアスバンクポインタ(PBP)10を
退避させ、汎用レジスタR0〜R3はバンク16に、汎
用レジスタR4〜R7はバンク17に、汎用レジスタR
8〜R11はバンク18に、汎用レジスタR12〜R1
5はバンク19に退避させ、合計で情報を退避させるの
に5バンクを使用することになる。退避させていく順序
は前述したように、この例で述べると、図示したように
1〜5の順序でバンク19から小さいバンク番号の方
へ、と退避させていく。
Program counter (PC) 7a, processor status word (PSW) 8a, user stack pointer (USP) are stored in bank 15 of bank (RAM) 2.
9a and the Previa Bank Pointer (PBP) 10 are saved, the general-purpose registers R0 to R3 are stored in the bank 16, the general-purpose registers R4 to R7 are stored in the bank 17, and the general-purpose register R is stored.
8 to R11 are bank 18 and general-purpose registers R12 to R1
5 are saved in the bank 19, and 5 banks are used to save the information in total. As described above in this example, the order of evacuation is evacuation from the bank 19 to the smaller bank number in the order of 1 to 5 as illustrated.

【0066】バンク(RAM)2への情報の退避も終わ
り、割込ハンドラ先頭番地も生成されると割込ハンドン
先頭番地に分岐していく。割込ハンドラ先頭番地には、
EITモードと呼ばれるモード設定コマンドが1ワード
分設けられている。これからEITモードについて説明
をする。割込ハンドラ先頭番地に設けられたEITモー
ドの各モードをセットすることで、割込ハンドラルーチ
ンで使用するモードを設定できる。
When the saving of information in the bank (RAM) 2 is completed and the start address of the interrupt handler is generated, the process branches to the start address of the interrupt handon. At the start address of the interrupt handler,
A mode setting command called EIT mode is provided for one word. The EIT mode will be described below. By setting each mode of the EIT mode provided at the first address of the interrupt handler, the mode used in the interrupt handler routine can be set.

【0067】EITモードの中で、バンクを切り換える
ことができるビット割付がされている(バンク切換モー
ド)。バンク数が全部で256バンク存在すると図3
(d) に示すように、EITモードの下位8ビットを使っ
て表すことが出来る。バンク番号が、0以外の値がセッ
トされていたとすると、それはバンクを切り換えること
を意味するものである。
In the EIT mode, bits are assigned so that banks can be switched (bank switching mode). If there are a total of 256 banks,
As shown in (d), it can be expressed by using the lower 8 bits of the EIT mode. If the bank number is set to a value other than 0, it means that the bank is switched.

【0068】このバンク番号に基づいて戻り情報の保存
を行う動作を開始する。先ずカレントバンクポインタ
(CBP)11の示す値を、プレビアスバンクポインタ
(PBP)10に転送する。これで前に使っていたバン
ク番号を記憶できる。これから割込みで使うバンク番号
をカレントバンクポインタ(CBP)11に転送する。
指定されたバンクから汎用レジスタR0〜R15の情報
をレジスタファイル9に転送してくる。
The operation of storing the return information is started based on this bank number. First, the value indicated by the current bank pointer (CBP) 11 is transferred to the previous bank pointer (PBP) 10. Now you can remember the bank number you were using before. The bank number used in the interrupt is transferred to the current bank pointer (CBP) 11.
Information of the general-purpose registers R0 to R15 is transferred to the register file 9 from the designated bank.

【0069】バンク番号が、0の値がセットされていた
とすと、それはバンクを切り換えないことを意味する。
バンクを切り換えない動作は、バンクに退避したプログ
ラムカウンタ(PC)7a、プロセサステータスワード
(PSW)8a、ユーザスタックポインタ(USP)9
a、プレビアスバンクポインタ(PBP)10は無効と
なり、新たに別の場所に退避させることになる。スタッ
クポインタの示す値の領域に退避することになる。
If the bank number is set to a value of 0, it means that the bank is not switched.
The operation without switching the bank is performed by the program counter (PC) 7a, the processor status word (PSW) 8a, and the user stack pointer (USP) 9 saved in the bank.
a, the Previous Bank Pointer (PBP) 10 becomes invalid and will be newly saved to another location. It is saved in the area of the value indicated by the stack pointer.

【0070】バンクを切り換えないので、プレビアスバ
ンクポインタ(PBP)10には0をセットし、カレン
トバンクポインタ(CBP)は変更の必要はない。ま
た、バンクを切り換えないので、レジスタファイル9に
存在する汎用レジスタR0〜R15を使用する。
Since the banks are not switched, 0 is set in the pre-bank bank pointer (PBP) 10 and the current bank pointer (CBP) does not need to be changed. Further, since the banks are not switched, the general purpose registers R0 to R15 existing in the register file 9 are used.

【0071】しかし、プログラムカウンタ(PC)7
a、プロセサステータスワード(PSW)8a、ユーザ
スタックポインタ(USP)9a、プレビアスバンクポ
インタ(PBP)10を退避させるために一時的記憶レ
ジスタとして汎用レジスタR12〜R15を前に使用し
たので、バンク(RAM)2からレジスタファイル9の
汎用レジスタR12〜R15を書き戻す必要がある。汎
用レジスタR12〜R15の保存が必要な場合は、プロ
グラムでスタックなどに退避するか、プログラムでバン
クを切り換える。
However, the program counter (PC) 7
a, the processor status word (PSW) 8a, the user stack pointer (USP) 9a, and the pre-previous bank pointer (PBP) 10, the general-purpose registers R12 to R15 were previously used as temporary storage registers. It is necessary to write back the general purpose registers R12 to R15 of the register file 9 from the RAM2. When the general-purpose registers R12 to R15 need to be saved, they are saved in a stack or the like by a program or banks are switched by a program.

【0072】EITモードの中に、図3(e) に示すよう
に、割込ハンドラルーチンの中で使用するレジスタの数
をセットできるビットを割り付けたとすることができる
(使用レジスタ数モード)。
As shown in FIG. 3 (e), it is possible to allocate bits capable of setting the number of registers used in the interrupt handler routine in the EIT mode (used register number mode).

【0073】バンク(RAM)2に退避している情報を
レジスタファイル9に転送するのに専用バス6を使っ
て、1度に4つのレジスタの内容を転送することにな
り、使用レジスタ数は4の倍数に相当することになるの
で、4、8、12、16の4ケースが存在し、2ビット
で表現可能である。
The dedicated bus 6 is used to transfer the information saved in the bank (RAM) 2 to the register file 9, and the contents of four registers are transferred at a time. Therefore, there are four cases of 4, 8, 12, and 16, which can be represented by 2 bits.

【0074】割込ハンドラルーチンでレジスタの数はあ
まり多く使用しないときに、使用レジスタ数を4あるい
は8レジスタ数にすれば、不必要なレジスタを転送する
時間が省略できて速く割込ハンドラルーチンの実行開始
ができる。
When the number of registers used in the interrupt handler routine is not so large, if the number of used registers is set to 4 or 8 registers, unnecessary register transfer time can be omitted and the interrupt handler routine can be executed quickly. Can start execution.

【0075】割込ハンドラルーチン実行中に別の現在実
行中の割込みより優先順位が高い割込みが発生し、受付
けられたとする。この場合も前述した退避動作を開始す
る。最初の割込みを割込み1とし、後からの割込みを割
込み2とする。割込み2の場合もプログラムカウンタ
(PC)7a、プロセサステータスワード(PSW)8
a、ユーザスタックポインタ(USP)9a、プレビア
スバンクポインタ(PBP)10、汎用レジスタR0〜
R15の情報を退避させる。
It is assumed that another interrupt having a higher priority than that of the currently executing interrupt is generated and accepted during execution of the interrupt handler routine. Also in this case, the evacuation operation described above is started. The first interrupt is interrupt 1, and the subsequent interrupt is interrupt 2. In the case of interrupt 2 also, the program counter (PC) 7a and processor status word (PSW) 8
a, user stack pointer (USP) 9a, previous bank pointer (PBP) 10, general-purpose register R0
The information in R15 is saved.

【0076】ここでEITモードの使用レジスタ数モー
ドが有効的になる。割込み1で例えば使用レジスタ数が
4レジスタだとすると、バンク(RAM)2に転送する
回数は、プログラムカウンタ(PC)7a、プロセサス
テータスワード(PSW)8a、ユーザスタックポイン
タ(USP)9a、プレビアスバンクポインタ(PB
P)10の組と汎用レジスタR0〜R3の組の2回の転
送で済むことになる。
Here, the number-of-used-registers mode of the EIT mode becomes effective. If, for example, the number of used registers is 4 in interrupt 1, the number of times of transfer to the bank (RAM) 2 is as follows: the program counter (PC) 7a, the processor status word (PSW) 8a, the user stack pointer (USP) 9a, and the previous bank pointer. (PB
P) 10 sets and general-purpose registers R0 to R3 are transferred twice.

【0077】つまり、汎用レジスタR0〜R15を全て
転送しないでよく、処理スピードの向上につながる。復
帰も、前述したことが当てはまり、割込み2が割込処理
終了後、割込ハンドラを抜けるときに、汎用レジスタR
0〜R3の退避が必要であれば、使用したレジスタ分の
み退避すればよいことになる。
That is, it is not necessary to transfer all of the general purpose registers R0 to R15, which leads to an improvement in processing speed. The same applies to the return, and when the interrupt 2 exits the interrupt handler after the interrupt processing is completed, the general register R
If it is necessary to save 0 to R3, only the used registers need to be saved.

【0078】この他に、図3(f) に示すように、スタッ
ク指定モードを割付けると割込ハンドラルーチンで使用
するスタックを指定することができる。(スタック指定
モード)
In addition, as shown in FIG. 3 (f), if the stack designation mode is assigned, the stack used in the interrupt handler routine can be designated. (Stack specification mode)

【0079】また、前述した3種のモードを1ワードに
割り当てることもできる。例として図3(g) に示すよう
に、バンク番号指定モードに下位8ビット、スタック指
定モードに上位8ビットの内の2ビットにユーザスタッ
クポインタ(USP)9a、インタラプトスタックポイ
ンタ(ISP)9a、エミュレータスタックポインタ
(ESP)9cを、使用レジスタ数モードに上位8ビッ
トの内の別の2ビットを割り付け、残り4ビットは未定
義とすることもできる。またその他に、図3(h) に示す
ように、割込優先順位指定モードを割付けると割込ハン
ドラルーチンで使用する割込みレベルを指定できる。
Further, the above-mentioned three modes can be assigned to one word. As an example, as shown in FIG. 3 (g), the lower 8 bits in the bank number designation mode, the upper 8 bits in the stack designation mode, the user stack pointer (USP) 9a and the interrupt stack pointer (ISP) 9a in 2 bits. The emulator stack pointer (ESP) 9c may be assigned another 2 bits of the upper 8 bits to the used register number mode, and the remaining 4 bits may be undefined. In addition, as shown in FIG. 3 (h), if the interrupt priority designation mode is assigned, the interrupt level used in the interrupt handler routine can be designated.

【0080】この割込みレベル指定モードを割り付ける
ことによりユーザ定義の割込みレベルが指定可能にな
る。例えばEITモードの中に、この割込優先順位指定
モードが存在しなかったとする。IMフラグに2にセッ
トされている時、割込優先順位2を表す。優先順位の示
す値が大きい程、優先順位は高いことになる。発生した
割込要因の優先順位5のときに、IMフラグが2をセッ
トされていたとき、発生した割込要因の方が、優先順位
が高いので、割込みを受付つけることになる。そして、
IMフラグに受付けた割込み優先順位を1レベルあげた
値をセットし、この例ではIMフラグを6にセットす
る。
By assigning this interrupt level designation mode, a user-defined interrupt level can be designated. For example, it is assumed that this interrupt priority order designation mode does not exist in the EIT mode. When the IM flag is set to 2, it represents an interrupt priority of 2. The larger the value indicated by the priority, the higher the priority. When the IM flag is set to 2 when the priority level of the generated interrupt factor is 5, the interrupt factor generated has a higher priority level, and therefore the interrupt is accepted. And
The IM flag is set to a value obtained by raising the accepted interrupt priority by one level, and in this example, the IM flag is set to 6.

【0081】ここで問題になるのが、優先順位5の割込
みを受付けたときIMフラグは6を示す。受付けた割込
要因より優先順位の高い優先順位7の割込みが存在する
ことである。
The problem here is that the IM flag indicates 6 when an interrupt of priority 5 is accepted. This means that there is an interrupt of priority 7 which has a higher priority than the accepted interrupt factor.

【0082】つまり、優先順位5の割込処理を実行中
に、二重割込みが発生する可能性がある。この時、ユー
ザとしては現在割込処理中の割込要因に関しては、ノン
マスカブルな割込以外は、受付けたくないと言う要望が
出てくる。そこで、この割込優先順位指定モードの存在
により、このような例に対しての要望であれば通常を6
でセットされているIMフラグを割込優位指定モードで
最高優先順位7にセットすればノンマスカプルな割込み
以外は、受付けないことになる。但し、割込優先順位の
変更をしないで、IMフラグに従った優先順位6を希望
するならば、割込優先順位指定モードに0をセットする
ことで、割込優先順位の変更をしないようにする。
In other words, there is a possibility that a double interrupt will occur during execution of an interrupt process of priority 5. At this time, there is a demand from the user that he / she does not want to accept any interrupt factor other than the non-maskable interrupt currently being processed. Therefore, if there is a request for such an example due to the existence of this interrupt priority order specifying mode, the normal 6
If the IM flag set in step 2 is set to the highest priority level 7 in the interrupt precedence designation mode, only non-maskable interrupts will be accepted. However, if you want the priority 6 according to the IM flag without changing the interrupt priority, set 0 in the interrupt priority designation mode so that the interrupt priority is not changed. To do.

【0083】前述してきたことの中で、ベクタ値が連続
なる値で割付けられたことにより、必要とされる動作で
あった。あらかじめベクタ値を連続なる値にしないで、
ある程度の間隔を持たせて尚且つ、間隔、等間隔に割当
てないで各割込み要因にあった割付けをする。
In the above, the operation was required because the vector values were assigned with consecutive values. Do not make the vector values continuous in advance,
Allocation is made according to each interrupt factor with a certain interval and without being allocated at equal intervals.

【0084】例えば、割込ハンドラのエリアを多く必要
とする場合、次のベクタ値との間隔は多くとったり、割
込ハンドラのエリアとしては2ワードあれば十分という
時には、ベクタ値の間隔を4でセットすればよいことに
なる。
For example, when a large area for the interrupt handler is required, the interval between the next vector value is large, or when 2 words are sufficient for the area for the interrupt handler, the vector value interval is set to 4. It should be set.

【0085】このベクタ値の割付方法をとれば、ハード
ウェア構成はベクタ値をシフトさせないでアドレスラッ
チさせる構成になる。前者と後者の組み合わせによるベ
クタ値の割り付けで、割込要因数を増やすことも考えら
れる。
With this vector value allocation method, the hardware configuration is such that the vector value is not shifted but the address is latched. It is possible to increase the number of interrupt factors by allocating vector values by combining the former and the latter.

【0086】また、前述したEITモードは、割込ハン
ドラの中の1ワード分程設けられていることで説明した
が、バンク切換え、スタック指定、使用レジスタなど
の、それ以外のモード設定が必要となる場合は、図3
(h) に示す拡張モードのように、EITモードの1ワー
ドを2、3ワードと拡張することで、モード設定コマン
ド(EITモード)で多くのモードを設定できる。な
お、この発明は上記実施例に限定されるものではなく、
要旨を変更しない範囲で変形して実施できる。
Although the EIT mode described above is provided for about one word in the interrupt handler, it is necessary to set other modes such as bank switching, stack designation, and registers used. If so, see Figure 3.
As in the extended mode shown in (h), by expanding one word in the EIT mode to a few words, many modes can be set by the mode setting command (EIT mode). The present invention is not limited to the above embodiment,
Modifications can be made without changing the gist.

【0087】上記実施例では、レジスタバンク構成をも
つシングルチップマイクロコンピュータについて説明し
てきた。しかし、本発明の主旨である、EITモードを
マイクロプログラムで解釈し、割込ハンドラルーチン開
始前に、様々なモード設定を完了する方式は、レジスタ
バンク構成を採らないシングルチップマイクロコンピュ
ータでも十分に有効であることは言うまでもない。
In the above embodiments, the single chip microcomputer having the register bank structure has been described. However, the method of interpreting the EIT mode by the microprogram and completing various mode settings before the start of the interrupt handler routine, which is the gist of the present invention, is sufficiently effective even in a single-chip microcomputer without a register bank configuration. Needless to say.

【0088】[0088]

【発明の効果】従来の技術では、バンク切換え、システ
ムモードの切換えなど割込処理ルーチンの実行が開始さ
れてからプログラムの記述によって切換える必要があ
り、実際の割込処理ルーチンを実行するまでに割込みを
受付けてから、著しく割込応答処理時間が必要とされて
きた。
According to the conventional technique, it is necessary to switch the interrupt processing routine such as bank switching and system mode switching after the execution of the interrupt processing routine is started, and the interrupt processing routine is executed before the actual interrupt processing routine is executed. Since the acceptance of the request, the interrupt response processing time has been remarkably required.

【0089】この発明によれば、同じ条件のモード設定
をして実際の割込処理ルーチンを開始するまでの応答時
間はEITモードの存在により、EITモードはマイク
ロプログラム制御できるので従来の割込応答処理時間よ
り著しく短縮できるようになった。
According to the present invention, the response time before setting the mode under the same condition and starting the actual interrupt processing routine is the existence of the EIT mode, and the EIT mode can be microprogram controlled, so that the conventional interrupt response is possible. The processing time can be shortened significantly.

【図面の簡単な説明】[Brief description of drawings]

【図1】この発明を説明するためのシステム構成を示す
ブロック構成図。
FIG. 1 is a block configuration diagram showing a system configuration for explaining the present invention.

【図2】同システムのCPUの内部構成を示すブロック
構成図。
FIG. 2 is a block configuration diagram showing an internal configuration of a CPU of the system.

【図3】この発明の一実施例の構成と動作を説明するた
めのEITモードの構成と他の情報配列の説明図。
FIG. 3 is an explanatory diagram of a configuration of an EIT mode and another information array for explaining the configuration and operation of one embodiment of the present invention.

【図4】同実施例の退避動作を説明するためのCPUの
レジスタファイルを中心としたブロック構成図。
FIG. 4 is a block configuration diagram centering on a register file of the CPU for explaining the saving operation of the embodiment.

【図5】従来の割込応答処理の説明図。FIG. 5 is an explanatory diagram of conventional interrupt response processing.

【符号の説明】[Explanation of symbols]

1…中央処理装置(CPU)、2…バンク(RAM)、
3…割込みコントローラ(IRC)、4…周辺デバイ
ス、5…メインシステムバス(MBUS)、6…専用バ
ス、7…バスインターフェース部(BIU)、7a…プ
ログラムカウンタ(PC) 8…算術論理演算部(ALU)、8a…プロセサステー
タスワード(PSW) 9…レジスタファイル、9a…ユーザスタックポインタ
(USP)、9b…インタラプトスタックポインタ(I
SP)、9c…エミレータスタックポインタ(ES
P)、10…プレビアスバンクポインタ(PBP)、1
1…カレントバンクポインタ(CBP)、12…コア内
部バス(IBUS)。
1 ... Central processing unit (CPU), 2 ... Bank (RAM),
3 ... Interrupt controller (IRC), 4 ... Peripheral device, 5 ... Main system bus (MBUS), 6 ... Dedicated bus, 7 ... Bus interface unit (BIU), 7a ... Program counter (PC) 8 ... Arithmetic logic operation unit ( ALU), 8a ... Processor status word (PSW) 9 ... Register file, 9a ... User stack pointer (USP), 9b ... Interrupt stack pointer (I
SP), 9c ... Emulator stack pointer (ES
P), 10 ... Previous Bank Pointer (PBP), 1
1 ... Current bank pointer (CBP), 12 ... Core internal bus (IBUS).

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】割込み要求の発生により読出される割込ハ
ンドラの先頭番地の少なくとも1ワード領域に、割込み
処理のためのシステム設定コマンドを設けたことを特徴
とする割込応答処理方式。
1. An interrupt response processing system characterized in that a system setting command for interrupt processing is provided in at least one word area of a leading address of an interrupt handler read upon generation of an interrupt request.
【請求項2】上記システム設定コマンドは情報を退避さ
せるバンクを指定するバンク切換,割込み処理で使用す
るレジスタ数を指定する使用レジスタ数,使用するスタ
ックを指定するスタック指定,の各コマンドを含むこと
を特徴とする請求項1記載の割込応答処理方式。
2. The system setting command includes respective commands of bank switching for specifying a bank for saving information, number of registers used for specifying the number of registers used in interrupt processing, and stack specification for specifying a stack to be used. The interrupt response processing method according to claim 1.
JP23380292A 1992-09-01 1992-09-01 Interruption response processing system Pending JPH0683640A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23380292A JPH0683640A (en) 1992-09-01 1992-09-01 Interruption response processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23380292A JPH0683640A (en) 1992-09-01 1992-09-01 Interruption response processing system

Publications (1)

Publication Number Publication Date
JPH0683640A true JPH0683640A (en) 1994-03-25

Family

ID=16960816

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23380292A Pending JPH0683640A (en) 1992-09-01 1992-09-01 Interruption response processing system

Country Status (1)

Country Link
JP (1) JPH0683640A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100716596B1 (en) * 2007-03-26 2007-05-09 새한에너테크 주식회사 Pouch type lithium secondary battery
CN105468310A (en) * 2015-11-17 2016-04-06 昇捷丰电子(厦门)有限公司 FPGA (Field Programmable Gate Array) control system of ink-jet printer, and control method of FPGA control system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100716596B1 (en) * 2007-03-26 2007-05-09 새한에너테크 주식회사 Pouch type lithium secondary battery
CN105468310A (en) * 2015-11-17 2016-04-06 昇捷丰电子(厦门)有限公司 FPGA (Field Programmable Gate Array) control system of ink-jet printer, and control method of FPGA control system
CN105468310B (en) * 2015-11-17 2019-01-15 昇捷丰电子(厦门)有限公司 A kind of the FPGA control system and its control method of ink jet numbering machine

Similar Documents

Publication Publication Date Title
JPS62243058A (en) Control method of interruption for multi-processor system
JP2003058381A (en) Processor realizing exception processing setting by program
JPH0683640A (en) Interruption response processing system
JPH07311686A (en) Computer system and method for generation and processing of system management interrupt in it
JPS6290728A (en) Interruption processing method
JPH056281A (en) Information processor
JP2585905B2 (en) Multitask execution device
JPH0668725B2 (en) Device for responding to interrupt condition in data processing system and method for responding to asynchronous interrupt condition
JPS6049352B2 (en) data processing equipment
JPS6097440A (en) Virtual multiprocessor device
JP3139310B2 (en) Digital signal processor
JP2972557B2 (en) Data transfer control device and control method
JP3127737B2 (en) Digital signal processor
JPS6352240A (en) Data processor
JP2876629B2 (en) Data processing device
JPH0375832A (en) Virtual machine control system
JPH06103224A (en) Interruption control device
JPH05233525A (en) Input/otuput processor
JPH0869382A (en) Semiconductor device
JPH03259339A (en) Data processor
JPH03188531A (en) Time-division multitask executing device
JPS61226839A (en) Event processing system
JPH04270441A (en) Data processor
JPH04256190A (en) Microcomputer having fuzzy operation function
JPH0247751A (en) Channel control system