JP2000148511A - Interruption processor for microcomputer and its interruption processing method - Google Patents

Interruption processor for microcomputer and its interruption processing method

Info

Publication number
JP2000148511A
JP2000148511A JP10324854A JP32485498A JP2000148511A JP 2000148511 A JP2000148511 A JP 2000148511A JP 10324854 A JP10324854 A JP 10324854A JP 32485498 A JP32485498 A JP 32485498A JP 2000148511 A JP2000148511 A JP 2000148511A
Authority
JP
Japan
Prior art keywords
interrupt processing
interrupt
cpu
microcomputer
ibap
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
JP10324854A
Other languages
Japanese (ja)
Inventor
Kiyoshi Fukushima
清 福嶋
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP10324854A priority Critical patent/JP2000148511A/en
Publication of JP2000148511A publication Critical patent/JP2000148511A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To shorten time to be required from the active state of an interruption signal outputted from a peripheral unit up to the start of practical processing based on an interruption processing program. SOLUTION: An interruption processing base address pointer(IBAP) 8 is included in a peripheral unit 7 and a central processing unit(CPU) 1 reads out the IBAP simultaneously with the reading of a vector address from an interruption controller(INTC) 5, adds the value of the IBAP to the value of a program counter(PC') read out from a register bank 4 and writes the added value in a PC 2 built in the CPU 1 itself. Since an address indicated by 'PC+IBAP' is the leading address of a program for executing original interruption processing, the prescribed interruption processing can be immediately started.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、コンテキストに
よる割り込み処理を行うマイクロコンピュータの割り込
み処理装置および割り込み処理方法に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to an interrupt processing apparatus and an interrupt processing method for a microcomputer which performs interrupt processing by context.

【0002】[0002]

【従来の技術】マイクロコンピュータ内のINTCユニ
ットは、内蔵する周辺ユニットや外部からの割り込み信
号を受け付けて、CPUに対して割り込みを行う。CP
Uは、割り込みリクエストを受け付けて割り込みを許可
する。この後、CPUは、INTCから割り込みベクタ
アドレスを読み出す。
2. Description of the Related Art An INTC unit in a microcomputer receives an interrupt signal from a built-in peripheral unit or an external device and interrupts a CPU. CP
U accepts the interrupt request and permits the interrupt. Thereafter, the CPU reads the interrupt vector address from INTC.

【0003】コンテキストスイッチングによる方法は、
割り込み処理を高速に行える方法である。すなわち、複
数のレジスタバンクを内蔵し、割り込み処理を行うとき
レジスタバンクを切り替えてCPUが必要とするデータ
(PCやPSW)を交換することで迅速に割り込み処理
を行う。
A method using context switching is as follows.
This is a method that can perform interrupt processing at high speed. That is, a plurality of register banks are built-in, and when interrupt processing is performed, the register bank is switched to exchange data (PC or PSW) required by the CPU, thereby quickly performing interrupt processing.

【0004】コンテキストスイッチングでは、CPUが
INTCから読み出すベクタアドレスには、切り替える
べきレジスタバンクの番号が格納されており、このレジ
スタバンクの番号のレジスタバンクの内容に基づいて割
り込みの処理を行う。
In context switching, the vector address read from the INTC by the CPU stores the number of the register bank to be switched, and performs interrupt processing based on the contents of the register bank of the register bank number.

【0005】割り込み処理プログラムでは、割り込みを
出力した周辺ユニットから、処理を行う時に必要となる
パラメータを読み出し、このパラメータから割り込みの
内容を判断してどの割り込み処理を実行するか決定す
る。
In the interrupt processing program, parameters necessary for processing are read from the peripheral unit that has output the interrupt, and the contents of the interrupt are determined from these parameters to determine which interrupt processing is to be executed.

【0006】従来のマイクロコンピュータの割り込み処
理装置の構成例を図7に示す。従来のマイクロコンピュ
ータは、CPU1と、INTC5と、周辺ユニットとし
てタイマ7と、それぞれに接続する内部BUS9を備え
ている。例では周辺ユニットをタイマ7のみとしている
が、これは任意である。
FIG. 7 shows a configuration example of a conventional microcomputer interrupt processing apparatus. The conventional microcomputer includes a CPU 1, an INTC 5, a timer 7 as a peripheral unit, and an internal BUS 9 connected to each. In the example, only the timer 7 is used as the peripheral unit, but this is optional.

【0007】タイマ7より出力する割り込み信号INT
Mがアクティブになると、INTC5は、これを受け付
けて割り込みリクエスト信号INTRQをアクティブに
する。CPU1は、INTRQがアクティブの時、割り
込みを受け付ける条件で割り込み許可信号INTAKを
アクティブにする。
The interrupt signal INT output from the timer 7
When M becomes active, the INTC 5 receives this and activates the interrupt request signal INTRQ. When INTRQ is active, the CPU 1 activates the interrupt permission signal INTAK under the condition for accepting an interrupt.

【0008】その後、CPU1は、INTC5から内部
BUS9を介してベクタアドレスを読み出す。この場合
タイマ7が割り込みソースであるので、タイマ7に相当
するベクタアドレスが読み出されることになる。
After that, the CPU 1 reads a vector address from the INTC 5 via the internal BUS 9. In this case, since the timer 7 is the interrupt source, the vector address corresponding to the timer 7 is read.

【0009】コンテキストにより割り込み処理を行うの
で、読み出されたベクタアドレスが指すアドレスには、
どの番号のレジスタバンクを示すかという情報が格納さ
れている。CPU1は、このレジスタバンクの番号を読
み出してレジスタバンクを切り替える。この時CPU1
内のPC2およびPSW3は、選ばれたレジスタバンク
4内に格納された値PC’およびPSW’と交換され
る。
Since the interrupt process is performed in accordance with the context, the address indicated by the read vector address includes
Information on which register bank is indicated is stored. The CPU 1 reads the register bank number and switches the register bank. At this time, CPU1
PC2 and PSW3 are replaced with the values PC 'and PSW' stored in the selected register bank 4.

【0010】その後、CPU1は、PC’の示すアドレ
スに分岐して割り込み処理を開始する。割り込み処理プ
ログラムでは、タイマ7から割り込み処理を行うのに必
要となるパラメータを読み出す。このパラメータは、例
えばタイマのカウント値等である。このパラメータを判
断してどの処理を行うべきかを決定し、行うべき処理の
プログラムの先頭へジャンプする。
Thereafter, the CPU 1 branches to an address indicated by PC 'and starts interrupt processing. In the interrupt processing program, parameters necessary for performing the interrupt processing are read from the timer 7. This parameter is, for example, a count value of a timer. By judging these parameters, it is determined which processing should be performed, and the processing jumps to the top of the processing program to be performed.

【0011】図8は、これまで説明した割り込み処理の
流れを説明するフローチャートであり、図9は、割り込
み処理プログラムの構造を示している。
FIG. 8 is a flowchart for explaining the flow of the interrupt processing described so far, and FIG. 9 shows the structure of the interrupt processing program.

【0012】以上説明したように、マイクロコンピュー
タは、割り込みを受け付けて割り込み処理を行うが、こ
の割り込み処理を高速に行うためコンテキストによる割
り込み処理を行っている。
As described above, the microcomputer accepts an interrupt and performs an interrupt process. In order to perform the interrupt process at a high speed, the microcomputer performs an interrupt process in a context.

【0013】しかし、以下に示すように割り込みソース
が同一でも、割り込み条件が複数存在する時はプログラ
ムにて分岐先を決定するため、高速な割り込み処理が実
行できなかった。
However, as described below, even when the interrupt source is the same, when a plurality of interrupt conditions exist, a branch destination is determined by a program, so that high-speed interrupt processing cannot be executed.

【0014】具体的には、コンテキストによる割り込み
処理で割り込み処理を実行する場合、レジスタバンクか
ら分岐先アドレスを読み出し、いったん分岐した後、更
に割り込みソースから分岐条件パラメータを読み出し、
このパラメータをプログラムによって判別し、本来処理
するべきプログラムの先頭アドレスへ分岐していた。こ
のことは本来の分岐先プログラムの実行にたどり着くま
でに多大なプログラムによる処理時間を必要とする。
Specifically, when executing interrupt processing by context-based interrupt processing, a branch destination address is read from a register bank, and after branching, a branch condition parameter is further read from an interrupt source.
This parameter is determined by the program, and the program branches to the head address of the program to be processed. This requires a great deal of processing time by the program before reaching the execution of the original branch destination program.

【0015】[0015]

【発明が解決しようとする課題】上述したように従来の
マイクロコンピュータのコンテキストによる割り込み処
理では、レジスタバンクを切り替え、割り込みプログラ
ムに分岐した後、割り込み処理を行うためのパラメータ
を周辺ユニットから読み出して、パラメータの値によっ
てどの割り込み処理を行うか判断し、対象となる割り込
み処理プログラムに更に分岐して処理を開始していた。
As described above, in the conventional interrupt processing in the context of a microcomputer, after switching register banks and branching to an interrupt program, a parameter for performing the interrupt processing is read from a peripheral unit. It is determined which interrupt processing is to be performed based on the value of the parameter, and the process is further branched to the target interrupt processing program to start the processing.

【0016】そのため周辺ユニットから出力する割り込
み信号がアクティブになってから実際の割り込み処理プ
ログラムによる処理が開始されるまでに多くの時間を必
要とし、割り込み処理の応答が悪いという欠点があっ
た。
[0016] Therefore, there is a drawback that a long time is required from when the interrupt signal output from the peripheral unit becomes active to when the processing by the actual interrupt processing program is started, and the response of the interrupt processing is poor.

【0017】例えば、サーボモータを制御するマイクロ
コンピュータでは、タイマからの割り込みを利用してサ
ーボモータの回転数を制御することができる。しかし、
従来のマイクロコンピュータの割り込み処理方法では、
コンテキストを使用した場合でも、本当に実行するべき
処理を開始するまでには、更にタイマからパラメータを
読み出して判断する必要があった。この場合、割り込み
が受け付けられて実際の処理が開始されるまでに、プロ
グラムによるパラメータの判断が必要なため多大な時間
がかかる。従って、タイマの割り込みが発生し、サーボ
モータを制御する場合では、サーボモータ制御が間に合
わないという大きな欠点があった。
For example, in a microcomputer that controls a servomotor, the number of revolutions of the servomotor can be controlled by using an interrupt from a timer. But,
In the conventional microcomputer interrupt processing method,
Even when a context is used, it is necessary to read parameters from the timer and make a decision before starting the processing to be really executed. In this case, it takes a great deal of time since the program needs to determine the parameters until the interrupt is accepted and the actual processing is started. Therefore, when the timer is interrupted and the servomotor is controlled, there is a serious disadvantage that the servomotor control cannot be performed in time.

【0018】この発明の目的は、周辺ユニットから出力
する割り込み信号がアクティブになってから実際の割り
込み処理プログラムによる処理が開始されるまでの時間
が短縮され、高速な割り込み処理が可能なマイクロコン
ピュータの割り込み処理装置および割り込み処理方法を
提供することにある。
An object of the present invention is to reduce the time from when an interrupt signal output from a peripheral unit becomes active to when processing by an actual interrupt processing program is started, and to realize a microcomputer capable of high-speed interrupt processing. An object of the present invention is to provide an interrupt processing device and an interrupt processing method.

【0019】[0019]

【課題を解決するための手段】この発明は、コンテキス
トによる割り込み処理を行うマイクロコンピュータの割
り込み処理装置において、割り込み発生時にCPUが割
り込みコントローラから割り込み処理分岐に必要なパラ
メータを読み出して、CPUのレジスタバンク内に格納
している分岐先アドレスと加算し、新たな分岐先アドレ
スとして割り込み処理プログラムの先頭アドレスへ直接
分岐することを特徴とする。
SUMMARY OF THE INVENTION The present invention relates to an interrupt processing apparatus for a microcomputer which performs interrupt processing in context, in which a CPU reads parameters necessary for interrupt processing branch from an interrupt controller when an interrupt occurs and registers the register bank of the CPU. Is added to the branch destination address stored in the register, and the program branches directly to the start address of the interrupt processing program as a new branch destination address.

【0020】また、この発明は、コンテキストによる割
り込み処理を行うマイクロコンピュータの割り込み処理
方法において、割り込み発生時にCPUが割り込みコン
トローラから割り込み処理分岐に必要なパラメータを読
み出して、CPUのレジスタバンク内に格納している分
岐先アドレスと加算し、新たな分岐先アドレスとして割
り込み処理プログラムの先頭アドレスへ直接分岐するこ
とを特徴とする。
According to the present invention, in a microcomputer interrupt processing method for performing interrupt processing in context, when an interrupt occurs, a CPU reads parameters necessary for interrupt processing branch from an interrupt controller and stores the parameters in a register bank of the CPU. And adding a new branch destination address and branching directly to the start address of the interrupt processing program as a new branch destination address.

【0021】[0021]

【発明の実施の形態】次に、この発明の実施の形態につ
いて図面を参照して説明する。
Next, an embodiment of the present invention will be described with reference to the drawings.

【0022】図1は、この発明のマイクロコンピュータ
の割り込み処理装置の第1の実施の形態を示すブロック
図である。図2は、CPU内のこの発明に関係する部分
を説明するブロック図である。
FIG. 1 is a block diagram showing a first embodiment of an interrupt processing device for a microcomputer according to the present invention. FIG. 2 is a block diagram illustrating a portion related to the present invention in the CPU.

【0023】図1に示すマイクロコンピュータの割り込
み処理装置は、中央処理装置(CPU)1と、割り込み
コントローラ(INTC)5と、タイマ7と、各ユニッ
トを双方向に接続する内部BUS9とを備えて構成され
ている。
The interrupt processing device of the microcomputer shown in FIG. 1 includes a central processing unit (CPU) 1, an interrupt controller (INTC) 5, a timer 7, and an internal BUS 9 for connecting each unit bidirectionally. It is configured.

【0024】また、CPU1は、内部にプログラムカウ
ンタ(PC)2、PSW3、レジスタバンク4を備えて
おり、INTC5は、内部に割り込み処理ベースアドレ
スポインタ(IBAP)6を備えており、タイマ7は、
内部にIBAP8を備えている。
The CPU 1 has a program counter (PC) 2, a PSW 3 and a register bank 4 therein, the INTC 5 has an interrupt processing base address pointer (IBAP) 6 therein, and the timer 7 has
An IBAP 8 is provided inside.

【0025】この実施の形態では周辺ユニット(タイ
マ)を1つだけで構成しているが、周辺ユニットの個数
は任意である。
In this embodiment, only one peripheral unit (timer) is provided, but the number of peripheral units is arbitrary.

【0026】図1において、INTMは、タイマ7から
出力する割り込み要求信号であり、INTRQは、IN
TC5に入力するINTMがアクティブの時CPU1に
対して割り込みリクエストを行う信号であり、INTA
Kは、CPU1に入力するINTRQのアクティブレベ
ルを関知して割り込み許可タイミングでアクティブとな
る割り込み許可信号である。
In FIG. 1, INTM is an interrupt request signal output from the timer 7, and INTRQ is
This signal is used to make an interrupt request to the CPU 1 when INTM input to TC5 is active.
K is an interrupt enable signal which becomes active at the interrupt enable timing in response to the active level of INTRQ input to the CPU 1.

【0027】図2は、CPU内におけるレジスタバンク
4と、テンポラリレジスタ(TMPA)11と、テンポ
ラリレジスタ(TMPB)12と、加算器(ALU)1
3と、PC2を示している。
FIG. 2 shows a register bank 4 in the CPU, a temporary register (TMPA) 11, a temporary register (TMPB) 12, and an adder (ALU) 1.
3 and PC2.

【0028】この実施の形態と図7に示す従来のマイク
ロコンピュータとの違いは、タイマ内にIBAP8レジ
スタを設け、INTC内に同様にIBAP6を設けたこ
とである。更に、分岐先のアドレスであるPCの値を、
図2に示すように、レジスタバンク4からPC’を読み
出してTMPA11に格納し、IBAPの値をTMPB
12に格納し、ALU13にて加算することで得てい
る。
The difference between this embodiment and the conventional microcomputer shown in FIG. 7 is that an IBAP8 register is provided in the timer and an IBAP6 is similarly provided in the INTC. Further, the value of PC, which is the address of the branch destination, is
As shown in FIG. 2, PC ′ is read from the register bank 4 and stored in TMPA11, and the value of IBAP is changed to TMBPB.
12 and added by the ALU 13 to obtain.

【0029】次に、第1の実施の形態の動作について図
1、図2、図3および図4を参照して説明する。図3
は、第1の実施の形態の割り込み処理の流れを説明する
フローチャートであり、図4は、割り込み処理プログラ
ムのアドレスマップを示す図である。
Next, the operation of the first embodiment will be described with reference to FIGS. 1, 2, 3 and 4. FIG.
FIG. 4 is a flowchart illustrating the flow of an interrupt process according to the first embodiment, and FIG. 4 is a diagram illustrating an address map of an interrupt processing program.

【0030】タイマ7から出力する割り込み要求信号I
NTMがアクテイブとなり、INTC5に対して割り込
み要求を行う。INTC5は、INTMがアクティブに
なったことを関知して割り込み要求を受け付け、CPU
1に対する割り込みリクエスト信号INTRQをアクテ
ィブにする。
Interrupt request signal I output from timer 7
NTM becomes active and issues an interrupt request to INTC5. The INTC 5 receives the interrupt request in response to the fact that the INTM has become active, and
Activate the interrupt request signal INTRQ for 1

【0031】次に、タイマ7内にあるIBAP8の値が
内部BUS9を介してINTC5内のIBAP6に格納
される。この処理は、INTC5が実行してもCPU1
が実行してもよい。
Next, the value of IBAP8 in the timer 7 is stored in the IBAP6 in the INTC5 via the internal BUS9. This processing is executed by the CPU 1 even if the INTC 5 executes it.
May be performed.

【0032】次に、CPU1は、割り込みを受け付けら
れる条件(例えば実行している処理の中で割り込み受け
付け許可できる条件が整った時)で割り込み許可信号I
NTAKをアクティブにする。
Next, the CPU 1 outputs the interrupt enable signal I under the condition that the interrupt can be accepted (for example, when the condition for enabling the interrupt is satisfied in the process being executed).
Activate NTAK.

【0033】CPU1は、INTC5からベクタアドレ
スとIBAP6の値を読み出す。IBAP6の値は、図
2で示すTMPB12に格納される。コンテキストによ
る割り込み処理を行うので、CPU1は、読み出したベ
クタアドレスが示すアドレスからレジスタバンクの番号
を読み出す。CPU1は、読み出されたレジスタバンク
の番号が示すレジスタバンク4に切り替える。
The CPU 1 reads the vector address and the value of IBAP6 from the INTC5. The value of IBAP6 is stored in TMPB12 shown in FIG. Since the interrupt process is performed by the context, the CPU 1 reads the register bank number from the address indicated by the read vector address. The CPU 1 switches to the register bank 4 indicated by the read register bank number.

【0034】図2において、CPU1は、レジスタバン
ク4内のPC’を読み出してTMPA11に転送する。
TMPA11とあらかじめTMPB12に格納されてい
たIBAPの値をALU13て加算し、結果をPC2へ
転送する。旧PCの値は、レジスタバンク内に書き込ま
れる。
In FIG. 2, the CPU 1 reads PC ′ in the register bank 4 and transfers it to the TMPA 11.
The value of the IBAP stored in the TMPA 11 and the TMPB 12 is added to the ALU 13 and the result is transferred to the PC 2. The old PC value is written into the register bank.

【0035】次に、レジスタバンクからPSW’を読み
出してPSW3へ書き込む。旧PSWの値は、レジスタ
バンクに書き込まれる。
Next, PSW 'is read from the register bank and written to PSW3. The old PSW value is written to the register bank.

【0036】CPU1は、PC2の値が示すアドレスに
分岐し、割り込み処理の実行に移る。図4で示すよう
に、IBAPの値によって実行する割り込み処理プログ
ラムが変更されることになる。
The CPU 1 branches to the address indicated by the value of the PC 2 and shifts to execution of interrupt processing. As shown in FIG. 4, the interrupt processing program to be executed is changed depending on the value of IBAP.

【0037】タイマ内に設けるIBAPは任意の値を保
持するが、例えば、あるタイマの読み出し値を保持する
でも良いし、CPUにより書き込まれる任意の値を保持
しても良い。
The IBAP provided in the timer holds an arbitrary value. For example, the IBAP may hold a read value of a certain timer or an arbitrary value written by the CPU.

【0038】図5は、この発明のマイクロコンピュータ
の割り込み処理装置の第2の実施の形態を示すブロック
図であり、図6は、割り込み処理の流れを説明するフロ
ーチャートである。
FIG. 5 is a block diagram showing a second embodiment of an interrupt processing device for a microcomputer according to the present invention, and FIG. 6 is a flowchart for explaining the flow of interrupt processing.

【0039】図5に示すマイクロコンピュータの割り込
み処理装置は、CPU1と、INTC5と、タイマ7
と、各ユニットを双方向に接続する内部BUS9とを備
えて構成されている。
The interrupt processing device of the microcomputer shown in FIG. 5 includes a CPU 1, an INTC 5, a timer 7
And an internal BUS 9 for connecting each unit bidirectionally.

【0040】また、CPU1は、内部にPC2、PAW
3、レジスタバンク4、IBAP10を備えており、タ
イマ7は、内部にIBAP8を備えている。
The CPU 1 has a PC 2 and a PAW inside.
3, a register bank 4, and an IBAP 10. The timer 7 has an IBAP 8 therein.

【0041】この実施の形態では周辺ユニットとしてタ
イマ1つを内蔵しているが、周辺ユニットの個数は任意
である。
In this embodiment, one timer is incorporated as a peripheral unit, but the number of peripheral units is arbitrary.

【0042】次に、図5と図6を参照して第2の実施の
形態の動作を説明する。
Next, the operation of the second embodiment will be described with reference to FIGS.

【0043】タイマ7から出力する割り込み要求信号I
NTMがアクテイブとなり、INTC5に対して割り込
み要求を行う。INTC5は、CPU1に対する割り込
みリクエスト信号INTRQをアクティブにする。
Interrupt request signal I output from timer 7
NTM becomes active and issues an interrupt request to INTC5. INTC5 activates an interrupt request signal INTRQ for CPU1.

【0044】CPU1は、タイマ7内にあるIBAP8
の値を内部BUS9を介してCPU1内のIBAP10
に格納する。次に、CPU1は、割り込みを受け付けら
れる条件(例えば、実行している処理の中で割り込み受
け付け許可できる条件が整った時)で割り込み許可信号
INTAKをアクティブにする。
The CPU 1 has an IBAP 8 in the timer 7
Value of IBAP10 in CPU 1 via internal BUS9
To be stored. Next, the CPU 1 activates the interrupt permission signal INTAK under the condition that the interrupt can be received (for example, when the condition for permitting the interrupt is satisfied in the executed processing).

【0045】CPU1は、INTC5からベクタアドレ
スを読み出す。コンテキストによる割り込み処理を行う
ので、CPU1は、読み出したベクタアドレスが示すア
ドレスからレジスタバンクの番号を読み出す。CPU1
は、読み出されたレジスタバンクの番号が示すレジスタ
バンクに切り替える。
CPU 1 reads the vector address from INTC5. Since the interrupt process is performed by the context, the CPU 1 reads the register bank number from the address indicated by the read vector address. CPU1
Switches to the register bank indicated by the read register bank number.

【0046】次に、CPU1は、レジスタバンク5内の
PC’を読み出し、IBAP10に格納されている値と
加算して結果をPC2へ転送する。旧PC2の値や旧P
SW3の値がレジスタバンクに書き込まれる手順は、第
1の実施の形態と同じである。CPU1は、PC2の値
が示すアドレスに分岐し、割り込み処理の実行に移る。
Next, the CPU 1 reads PC 'in the register bank 5, adds it to the value stored in the IBAP 10, and transfers the result to PC2. Old PC2 value and old P
The procedure for writing the value of SW3 to the register bank is the same as in the first embodiment. The CPU 1 branches to the address indicated by the value of the PC 2 and shifts to execution of interrupt processing.

【0047】以上説明した実施の形態は、周辺ユニット
内にIBAP8を設け、CPU1がINTC5からベク
タアドレスを読み出す時、同時にIBAPを読み出し
て、CPU1がレジスタバンク4から読み出すPC’の
値にIBAPの値を加え、CPU1内のPC2に書き込
みを行うように構成されている。PC+IBAPにて示
されるアドレスが、本来の割り込み処理を実行するプロ
グラムの先頭番地となっているので、直ちに所定の割り
込み処理を開始できる。これによって従来の割り込み処
理の応答が悪いという欠点を改善している。
In the embodiment described above, the IBAP 8 is provided in the peripheral unit, and when the CPU 1 reads the vector address from the INTC 5, the IBAP is read at the same time, and the value of the IBAP is read into the PC 'value read from the register bank 4 by the CPU 1. And writing to the PC 2 in the CPU 1 is performed. Since the address indicated by PC + IBAP is the start address of the program that executes the original interrupt processing, the predetermined interrupt processing can be started immediately. This improves the disadvantage that the response of the conventional interrupt processing is poor.

【0048】また、第2の実施の形態と、図1で示した
第1の実施の形態との違いは、IBAPをCPU1内に
内蔵したことにある。この場合、INTC5にIBAP
を設ける必要がないので、ハードウェア的に小さくでき
る利点がある。
The difference between the second embodiment and the first embodiment shown in FIG. 1 lies in that the IBAP is built in the CPU 1. In this case, IBAP is added to INTC5.
Since there is no need to provide the above, there is an advantage that the size can be reduced in terms of hardware.

【0049】また、CPU内に設けるIBAPは、CP
Uがアクセス可能な内蔵するメモリとしても良いし、汎
用レジスタとしても良いので、ハードウェア的な増加が
押さえられる利点がある。
The IBAP provided in the CPU is CP
Since it may be a built-in memory accessible by U or a general-purpose register, there is an advantage that an increase in hardware is suppressed.

【0050】更に、CPUが読み出せる領域であればど
の領域にIBAPを設定してもこの発明は実施可能であ
る。
Further, the present invention can be implemented in any area as long as the CPU can read the IBAP.

【0051】また、上述した実施の形態では、タイマ内
にIBAPを設けてタイマの任意の値を書き込めるよう
に構成しているが、このIBAPもタイマの内部の任意
の値が反映できる場所であれば、問題なくこの発明が実
施可能である。
Further, in the above-described embodiment, the IBAP is provided in the timer so that an arbitrary value of the timer can be written. However, the IBAP is also a place where the arbitrary value in the timer can be reflected. The present invention can be practiced without any problems.

【0052】[0052]

【発明の効果】以上説明したように、この発明のマイク
ロコンピュータの割り込み処理装置は、コンテキストに
よる割り込み処理でレジスタバンクからPCの値を読み
出し、あらかじめ読み出しておいたIBAPの値と加算
し、結果を新しいPCとして書き込むように構成したこ
とで、割り込み発生から実際の処理が開始されるまでの
期間がきわめて短くなり、割り込み処理の応答が向上す
るという大きな効果を有する。
As described above, the microcomputer interrupt processing apparatus of the present invention reads the value of PC from the register bank by the interrupt processing by context, adds the value of IBAP read in advance, and calculates the result. By writing as a new PC, the period from the occurrence of an interrupt to the start of actual processing is extremely shortened, and there is a great effect that the response to the interrupt processing is improved.

【0053】また、従来、割り込み処理プログラムの先
頭に記述されていた条件分岐判断プログラムが不必要と
なり、プログラムエリアを小さくですることができると
いう効果を有する。
In addition, the conditional branch judgment program which has been described at the head of the interrupt processing program becomes unnecessary, and the program area can be reduced.

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

【図1】この発明のマイクロコンピュータの割り込み処
理装置の第1の実施の形態を示すブロック図である。
FIG. 1 is a block diagram showing a first embodiment of an interrupt processing device of a microcomputer according to the present invention.

【図2】CPU内のこの発明に関係する部分を説明する
ブロック図である。
FIG. 2 is a block diagram illustrating a portion related to the present invention in a CPU.

【図3】第1の実施の形態の割り込み処理の流れを説明
するフローチャートである。
FIG. 3 is a flowchart illustrating a flow of an interrupt process according to the first embodiment;

【図4】割り込み処理プログラムのアドレスマップを示
す図である。
FIG. 4 is a diagram showing an address map of an interrupt processing program.

【図5】この発明のマイクロコンピュータの割り込み処
理装置の第2の実施の形態を示すブロック図である。
FIG. 5 is a block diagram showing a second embodiment of the microcomputer interrupt processing apparatus of the present invention.

【図6】第2の実施の形態の割り込み処理の流れを説明
するフローチャートである。
FIG. 6 is a flowchart illustrating a flow of an interrupt process according to the second embodiment;

【図7】従来のマイクロコンピュータの割り込み処理装
置の例を示すブロック図である。
FIG. 7 is a block diagram showing an example of a conventional microcomputer interrupt processing device.

【図8】従来の割り込み処理の流れを説明するフローチ
ャートである。
FIG. 8 is a flowchart illustrating a flow of a conventional interrupt process.

【図9】従来の割り込み処理プログラムの構造を示す図
である。
FIG. 9 is a diagram showing the structure of a conventional interrupt processing program.

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

1 中央処理装置(CPU) 2 プログラムカウンタ(PC) 3 PSW 4 レジスタバンク 5 割り込みコントローラ(INTC) 6,8,10 割り込み処理ベースアドレスポインタ
(IBAP) 7 タイマ 9 内部BUS 11 テンポラリレジスタ(TMPA) 12 テンポラリレジスタ(TMPB) 13 加算器(ALU)
Reference Signs List 1 Central processing unit (CPU) 2 Program counter (PC) 3 PSW 4 Register bank 5 Interrupt controller (INTC) 6, 8, 10 Interrupt processing base address pointer (IBAP) 7 Timer 9 Internal BUS 11 Temporary register (TMPA) 12 Temporary Register (TMPB) 13 Adder (ALU)

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】コンテキストによる割り込み処理を行うマ
イクロコンピュータの割り込み処理装置において、 割り込み発生時にCPUが割り込みコントローラから割
り込み処理分岐に必要なパラメータを読み出して、CP
Uのレジスタバンク内に格納している分岐先アドレスと
加算し、新たな分岐先アドレスとして割り込み処理プロ
グラムの先頭アドレスへ直接分岐することを特徴とする
マイクロコンピュータの割り込み処理装置。
An interrupt processing device for a microcomputer which performs interrupt processing in a context. In a microcomputer, when an interrupt occurs, a CPU reads parameters necessary for interrupt processing branch from an interrupt controller.
An interrupt processing apparatus for a microcomputer, which adds a branch destination address stored in a U register bank and directly branches to a start address of an interrupt processing program as a new branch destination address.
【請求項2】割り込み処理の時にCPUが読み出す前記
パラメータは、前記割り込みコントローラに替えて周辺
ユニットから直接読み出し、CPU内に格納することを
特徴とする請求項1に記載のマイクロコンピュータの割
り込み処理装置。
2. The microcomputer according to claim 1, wherein the parameter read by the CPU at the time of interrupt processing is read directly from a peripheral unit instead of the interrupt controller and stored in the CPU. .
【請求項3】割り込み処理の時にCPUが読み出す前記
パラメータは、割り込みを発生させた周辺ユニットに関
連する場所に格納されていることを特徴とする請求項2
に記載のマイクロコンピュータの割り込み処理装置。
3. The method according to claim 2, wherein the parameter read by the CPU at the time of interrupt processing is stored in a location related to the peripheral unit that generated the interrupt.
3. The interrupt processing device of the microcomputer according to claim 1.
【請求項4】割り込み処理の時にCPUが読み出す前記
パラメータを格納する場所は、CPUがアクセス可能な
記憶場所であることを特徴とする請求項2に記載のマイ
クロコンピュータの割り込み処理装置。
4. The microcomputer according to claim 2, wherein a location for storing the parameter read out by the CPU at the time of interrupt processing is a storage location accessible by the CPU.
【請求項5】コンテキストによる割り込み処理を行うマ
イクロコンピュータの割り込み処理方法において、 割り込み発生時にCPUが割り込みコントローラから割
り込み処理分岐に必要なパラメータを読み出して、CP
Uのレジスタバンク内に格納している分岐先アドレスと
加算し、新たな分岐先アドレスとして割り込み処理プロ
グラムの先頭アドレスへ直接分岐することを特徴とする
マイクロコンピュータの割り込み処理方法。
5. A microcomputer interrupt processing method for performing interrupt processing in a context, wherein a CPU reads a parameter necessary for interrupt processing branch from an interrupt controller when an interrupt occurs, and
A microcomputer interrupt processing method characterized by adding a branch destination address stored in a U register bank and branching directly to a start address of an interrupt processing program as a new branch destination address.
【請求項6】割り込み処理の時にCPUが読み出す前記
パラメータは、前記割り込みコントローラに替えて周辺
ユニットから直接読み出し、CPU内に格納することを
特徴とする請求項5に記載のマイクロコンピュータの割
り込み処理方法。
6. The method according to claim 5, wherein the parameter read by the CPU at the time of interrupt processing is read directly from a peripheral unit in place of the interrupt controller and stored in the CPU. .
【請求項7】割り込み処理の時にCPUが読み出す前記
パラメータは、割り込みを発生させた周辺ユニットに関
連する場所に格納されていることを特徴とする請求項6
に記載のマイクロコンピュータの割り込み処理方法。
7. The apparatus according to claim 6, wherein the parameter read by the CPU at the time of interrupt processing is stored in a location related to the peripheral unit which generated the interrupt.
3. The interrupt processing method of the microcomputer according to 1.
【請求項8】割り込み処理の時にCPUが読み出す前記
パラメータを格納する場所は、CPUがアクセス可能な
記憶場所であることを特徴とする請求項6に記載のマイ
クロコンピュータの割り込み処理方法。
8. The interrupt processing method according to claim 6, wherein a location for storing the parameter read by the CPU at the time of interrupt processing is a storage location accessible by the CPU.
JP10324854A 1998-11-16 1998-11-16 Interruption processor for microcomputer and its interruption processing method Pending JP2000148511A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10324854A JP2000148511A (en) 1998-11-16 1998-11-16 Interruption processor for microcomputer and its interruption processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10324854A JP2000148511A (en) 1998-11-16 1998-11-16 Interruption processor for microcomputer and its interruption processing method

Publications (1)

Publication Number Publication Date
JP2000148511A true JP2000148511A (en) 2000-05-30

Family

ID=18170402

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10324854A Pending JP2000148511A (en) 1998-11-16 1998-11-16 Interruption processor for microcomputer and its interruption processing method

Country Status (1)

Country Link
JP (1) JP2000148511A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007316840A (en) * 2006-05-24 2007-12-06 Seiko Epson Corp Processor, integrated circuit device and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007316840A (en) * 2006-05-24 2007-12-06 Seiko Epson Corp Processor, integrated circuit device and electronic equipment

Similar Documents

Publication Publication Date Title
JPH0193837A (en) Microprocessor for debug
JPH0221018B2 (en)
KR920010431A (en) Information processing device and information processing method using the same
US5628018A (en) Data processing apparatus handling plural divided interruption
US5600807A (en) Programmable controller capable of updating a user program during operation by switching between user program memories
JPS62115542A (en) Information processor
US5586336A (en) Microcomputer capable of monitoring internal resources from external
JP2000148511A (en) Interruption processor for microcomputer and its interruption processing method
JP2677458B2 (en) System call execution device
US7237099B2 (en) Multiprocessor system having a plurality of control programs stored in a continuous range of addresses of a common memory and having identification registers each corresponding to a processor and containing data used in deriving a starting address of a CPU-linked interrupt handler program to be executed by the corresponding processor
JPH0377137A (en) Information processor
JP2005018650A (en) Nonvolatile semiconductor storage device and data processor
JPH06324861A (en) System and method for controlling cpu
KR930003125B1 (en) Method for pregram loading on ram located in subprocessor system
JPH059815B2 (en)
JPH0481939A (en) Control system for microcomputer
KR950004227B1 (en) Information processing system
JP2560312B2 (en) Information processing system
JPH07114479A (en) Interruption control system
JPS60126731A (en) Program control method
JPH036758A (en) Microprocessor
JPH0795288B2 (en) Microcomputer
JPH08115213A (en) Digital signal processing and direct memory access control method therefor
JPH01204145A (en) Microprogram controller
JP2001015690A (en) System lsi and initializing method therefor