JPS62160537A - Interrupt processing - Google Patents

Interrupt processing

Info

Publication number
JPS62160537A
JPS62160537A JP61274260A JP27426086A JPS62160537A JP S62160537 A JPS62160537 A JP S62160537A JP 61274260 A JP61274260 A JP 61274260A JP 27426086 A JP27426086 A JP 27426086A JP S62160537 A JPS62160537 A JP S62160537A
Authority
JP
Japan
Prior art keywords
interrupt
processor
code
level
background
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
JP61274260A
Other languages
Japanese (ja)
Inventor
ブライアン・エドワード・ブレイア
マーク・ハーマン・ウエイス
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.)
International Business Machines Corp
Original Assignee
International Business Machines 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 International Business Machines Corp filed Critical International Business Machines Corp
Publication of JPS62160537A publication Critical patent/JPS62160537A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/24Handling requests for interconnection or transfer for access to input/output bus using interrupt
    • G06F13/26Handling requests for interconnection or transfer for access to input/output bus using interrupt with priority control

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bus Control (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】 A、産業上の利用分野 本発明は一般にデータ処理システムに関し、さらに詳細
には優先割込み要求を処理するための割込みシステムに
関するものである。
DETAILED DESCRIPTION OF THE INVENTION A. Field of Industrial Application This invention relates generally to data processing systems, and more particularly to interrupt systems for processing priority interrupt requests.

B、従来技術 一般のデータ処理装置のプロセッサは、装置内の種々の
タスクまたは事象を実行することを頻繁に要求される。
B. Prior Art The processor of a typical data processing device is frequently required to perform various tasks or events within the device.

タスクは、プロセッサにとって外部的なものであること
も、また内部的なものであることもある。外部タスクは
通常外部事象と関連する。そのような事象には、外部セ
ンサの読取り、通信チャネルからのデータの受取り等が
ある。内部タスクには、内部カウンタの終了に続く状態
の抽出等がある。
A task may be external to the processor or internal to the processor. External tasks are usually associated with external events. Such events include reading external sensors, receiving data from communication channels, and the like. Internal tasks include extracting states following completion of internal counters, etc.

指定されたタスクに加えて、プロセッサは通常、指定さ
れたタスクを処理するためにそのサービスが必要でない
とき、所定の機能(背景機能と呼ばれることがある)を
実行する。
In addition to the specified tasks, processors typically perform certain functions (sometimes referred to as background functions) when their services are not needed to process the specified tasks.

一般のプロセッサは、通常電子速度で動作する。Common processors typically operate at electronic speeds.

したがって、プロセッサ自体は割り当てられたタスクを
完了するのに比較的短かい時間間隔しか要しない。同様
に、プロセッサは非常に短かい時間間隔内で多数のタス
クを実行できる。その速度にもかかわらず、プロセッサ
は直列装置である。特定の時間間隔の間に1つのタスク
しか実行できない、その状態のきっかけになる事象が発
生すると、即座に対応が必要なタスクが幾つかある。た
とえば、実時間周辺装置は通常即座に対応が必要である
。大部分の実時間周辺装置は、背景コードの実行と非同
期的に動作するので、状況はさらに複雑である。すなわ
ち、これらの装置がサービスを必要とする正確な時間を
プロセッサが予想できない。
Therefore, the processor itself requires relatively short time intervals to complete its assigned tasks. Similarly, a processor can perform multiple tasks within a very short time interval. Despite its speed, processors are serial devices. There are several tasks that require immediate attention when an event occurs that triggers a condition in which only one task can be performed during a particular time interval. For example, real-time peripherals typically require immediate attention. The situation is further complicated because most real-time peripherals operate asynchronously with the execution of background code. That is, the processor cannot predict the exact time that these devices will require service.

プロセッサの融通性を向上させるため、割込みシステム
が設けられる。割込みシステムは優先順位をつけた幾つ
かの割込みレベルを含んでいる。
An interrupt system is provided to increase the flexibility of the processor. The interrupt system includes several prioritized interrupt levels.

ユーザは通常1つまたは複数の事象を割込みレベルの1
つに割り当てる。事象が発生するたびに割込み要求が提
出される。割込みのレベルに応じて、プロセッサは、新
しい割込みが発生したとき実行していたコードを引き続
き実行するか、またはそのレコードの処理を中止して、
新しい割込みにサービスするため実行しなければならな
い新しいコードに分岐する。割込み要求が、そのとき実
行中のものより高いレベルである場合、プロセッサは分
岐して新しいコードを実行する。それが終了すると、プ
ロセッサは戻って分岐前のコード(すなわち、元のコー
ド)を実行する6他方、割込み要求がそのとき実行中の
ものと同じかまたはそれより低いレベルである場合、プ
ロセッサはその割込み要求を待ち行列に入れ、現在のコ
ードを引き続き実行する。即座の対応を要する事象もあ
るので。
Users typically report one or more events at interrupt level 1.
Assign to. An interrupt request is submitted each time an event occurs. Depending on the level of the interrupt, the processor either continues executing the code it was executing when the new interrupt occurred or stops processing that record and
Branching to new code that must be executed to service the new interrupt. If the interrupt request is at a higher level than the one currently executing, the processor branches to execute new code. When it finishes, the processor returns and executes the pre-branch code (i.e., the original code).6 On the other hand, if the interrupt request is at the same or lower level than the one currently executing, the processor Queue the interrupt request and continue executing your current code. There are some events that require immediate response.

待ち行列は十分な解決策ではない6本発明が改善しよう
とするのは待ち行列の問題である。
Queuing is not a sufficient solution6 It is the queuing problem that the present invention seeks to improve.

従来技術では、幾つかの割込みシステムが記載されてい
る。開示されたシステムまたは構成は。
Several interrupt systems have been described in the prior art. The disclosed system or configuration is:

全て割込みを処理するためのプロセッサの効率を改善す
ることを目的としている。たとえば、米国特許第400
1783号、第4028664号、第417228号お
よび第3905025号には、プロセッサ割込み階層の
それぞれの割込みレベルでの事象のサービスに優先順位
をつけるための幾つかの装置および方法が述べられてい
る。
All are aimed at improving the efficiency of the processor for handling interrupts. For example, U.S. Pat.
No. 1783, No. 4028664, No. 417228, and No. 3905025 describe several apparatus and methods for prioritizing the servicing of events at respective interrupt levels of a processor interrupt hierarchy.

米国特許第4456970号および第4459657号
など別の従来技術の特許には、優先順位の低い事象にサ
ービスするコードから優先順位の高い事象にサービスす
る新しいコードに、プロセッサを分岐させる方法および
装置が述べられている。
Other prior art patents, such as U.S. Pat. It is being

C1発明が解決しようとする問題点 したがって、本発明の一般的目的は、複数の割込み要求
を待ち行列化せずに、プロセッサが単一の割込みレベル
で優先順位をつけたタスクを実行できる方法を提供する
ことにある。
SUMMARY OF THE INVENTION It is therefore a general object of the present invention to provide a method that allows a processor to perform prioritized tasks at a single interrupt level without queuing multiple interrupt requests. It is about providing.

D0問題点を解決するための手段 この方法は次のように働く。背景コード(すなわち、優
先順位の低いタスクにサービスするコード)の実行中に
割込みが発生した場合、プロセッサは分岐して、その割
込みを引き起こした事象にサービスするコードを実行す
る。背景コードの割込み時の位置のアドレスが、スタッ
ク上に保存される6割込みレベルで消費される時間を最
少にするため、2つの命令、すなわち、(a)  “C
a1lSub−routine”(呼出し)および(b
 )  ”Returnform Interrupt
” (RE T I )が割込みレベルで実行される。
Means to Solve the D0 Problem This method works as follows. If an interrupt occurs during the execution of background code (ie, code that services a lower priority task), the processor branches to execute the code that services the event that caused the interrupt. To minimize the time spent in the 6 interrupt levels where the address of the background code's location at the time of the interrupt is saved on the stack, two instructions are used: (a) “C
a1lSub-routine” (call) and (b
) ”Returnform Interrupt
” (RE T I ) is executed at interrupt level.

呼出し命令を実行すると、処理される予定になっている
命令の次の順次アドレスが、背景位置の1番上のスタッ
ク上に保存される。この特定の状況で割込みレベルの位
置がスタック上に保存される。
Execution of a calling instruction saves the next sequential address of the instruction to be processed on the top stack in a background location. In this particular situation the position of the interrupt level is saved on the stack.

RET工命令を実行すると、スタックの最上部から割込
みレベルの位置が取り出され、それがプログラム・カウ
ンタ(P、C,)にロードされる。
Execution of the RET instruction takes the interrupt level location from the top of the stack and loads it into the program counter (P, C,).

次にプロセッサはP、C,内のアドレス(位置)から始
まるサービス・ルーチンを実行する。RETI命令は割
込みのソースをクリアする(すなわち、全てのフラッフ
をリセットするなど)ことに注意すべきである。その割
込みに関係したサービス・ルーチン(すなわち、コード
)は背景レベルで実行され、プロセッサはこのとき同じ
割込みレベルの新しい割込み要求を自由に受け取ること
ができる。新しい割込み要求はただちにサービスされる
The processor then executes a service routine starting at the address (location) in P,C,. Note that the RETI instruction clears the source of the interrupt (ie, resets all fluffs, etc.). The service routine (ie, code) associated with that interrupt executes at a background level, and the processor is now free to accept new interrupt requests of the same interrupt level. New interrupt requests are serviced immediately.

最後に、割込み要求を処理するサービス・ルーチンが完
了したとき、リターン(RET)命令が実行される。こ
れにより、元の背景位置がスタックから取り出されてプ
ログラム・カウンタに入れられ、それによってプロセッ
サが背景コードの実行を継続できるようになる。
Finally, a return (RET) instruction is executed when the service routine that handles the interrupt request is completed. This causes the original background location to be taken off the stack and placed in the program counter, thereby allowing the processor to continue executing the background code.

E、実施例 以下に説明する発明を使って、任意の種類のデータ処理
システムで割込み要求に優先順位をつけることができる
。本発明は店舗システムでうまく働くので、その環境中
で説明することにする。ただし、本発明に小変更を加え
たり本発明を任意の計算システムに適用することは当業
者の熟練の範囲内に十分台まれるので、前記のことは本
発明の範囲を制限するものとして解釈すべきではない。
E. EXAMPLE The invention described below can be used to prioritize interrupt requests in any type of data processing system. Since the invention works well in a store system, it will be described in that environment. However, since it is well within the skill of those skilled in the art to make minor changes to the present invention or apply the present invention to any computing system, the foregoing should be construed as limiting the scope of the present invention. should not do.

第1図に、データ処理システム10の電気的ブロック・
ダイヤグラムを示す。データ処理システム10は、商店
、小売店等で客の買物を計算するためなどに使用するこ
とができる。データ処理システムは、マイクロコントロ
ーラまたはマイクロコンピュータ12を備えている。前
述のように。
FIG. 1 shows the electrical blocks of the data processing system 10.
Show diagram. Data processing system 10 may be used in stores, retail stores, etc., such as to calculate customer purchases. The data processing system includes a microcontroller or microcomputer 12. As aforementioned.

どんな種類のマイクロコンピュータでも使用できる。し
かし、本発明の好ましい実施例では、マイクロコントロ
ーラは、Inte1社製の8051型マイクロコントロ
ーラである。8051型マイクロコントローラは、周知
のオフ・ザ・シェルフ・マイクロコンピュータであり、
したがってここではその詳細は説明しない。このマイク
ロコントローラの詳細を確かめたい場合は、シングルチ
ップ・マイクロコンピュータと一緒に提供されるInt
e1社の資料を参考にするとよい。本発明においては、
8051型マイクロコントローラは複数の入出力機能を
実行し、それぞれの機能と遠隔の計算装置の間の通信を
もたらすように構成することができる。このマイクロコ
ンピュータは2つの割込みレベルを備えている。即座の
対応を必要とする各入出力装置と通信チャネルは、これ
らのレベルの1つでマイクロコントローラに割り込まな
ければならない。割込みが受諾された場合、マイクロコ
ントローラは現在のジョブを打ち切って、マイクロコン
トローラがその割込みを受諾した装置にサービスするた
めのコードを実行する。8051型コントローラには割
込みレベルが2つしかないため、各入出力装置と通信チ
ャネルからの割込みは、割込みレベルの1つに結合しな
ければならない。言い換えれば、複数の割込みを、1つ
の割込みレベルでサービスしなければならない。
Any kind of microcomputer can be used. However, in the preferred embodiment of the invention, the microcontroller is an Intel 8051 microcontroller. The 8051 type microcontroller is a well-known off-the-shelf microcomputer,
Therefore, the details will not be explained here. If you want to know more about this microcontroller, please refer to the Int.
You may want to refer to e1 company's materials. In the present invention,
The 8051 type microcontroller can be configured to perform multiple input/output functions and provide communication between each function and a remote computing device. This microcomputer has two interrupt levels. Each input/output device and communication channel that requires immediate attention must interrupt the microcontroller at one of these levels. If the interrupt is accepted, the microcontroller aborts the current job and executes code for the microcontroller to service the device that accepted the interrupt. Since the 8051 controller has only two interrupt levels, interrupts from each input/output device and communication channel must be bound to one of the interrupt levels. In other words, multiple interrupts must be serviced at one interrupt level.

引き続き第1図を参照すると、入出力装置は磁気ストラ
イプ読取機構(MSR)(図示せず)を備えている。磁
気ストライプ読取機構はコネクタ14を介してネットワ
ーク16に接続され、さらに導線18および20を介し
てマイクロコントローラのピン05および12に接続さ
れている。磁気ストライプ読取機構は、クレジット・カ
ード等の磁気情報を読取るために使用できる。ピン12
上の信号はストローブ信号であり、ピン05上の信号は
磁気ストライプ読取機構のデータ(MSRDAT)であ
る。たとえば、ストローブ信号が活動化されると、マイ
クロコントローラは割り込まれる。割込みがマイクロコ
ントローラ内のプロセッサによって受諾された場合、ピ
ン05上のデータが受諾される。
Continuing to refer to FIG. 1, the input/output device includes a magnetic stripe reader (MSR) (not shown). The magnetic stripe reader is connected via connector 14 to network 16 and via conductors 18 and 20 to pins 05 and 12 of the microcontroller. Magnetic stripe readers can be used to read magnetic information such as credit cards. pin 12
The signal on top is the strobe signal and the signal on pin 05 is the magnetic stripe reader data (MSRDAT). For example, when a strobe signal is activated, the microcontroller is interrupted. If the interrupt is accepted by the processor within the microcontroller, the data on pin 05 is accepted.

コネクタ22、およびマイクロコントローラのピン13
.10.15および11上のモジュール24と26によ
り通信機能がもたらされる。受信信号はピン10に供給
され、送信信号はピン11に与えられる。各モジュール
(22,24および26)は、それぞれ減結合ネットワ
ークによって電圧電源+5およびアースに結合されてい
る。通信チャネル(図示せず)からの信号は、コネクタ
22を介して受け取り、モジュール24によって増幅さ
れる。Texas Instruments (T I
 )社製のドライバ・モジュール部品番号75176が
、ドライバ・モジュールとして適している。モジュール
24からの信号は、モジュール26に送られる。
connector 22, and pin 13 of the microcontroller
.. Modules 24 and 26 on 10.15 and 11 provide communication functionality. The received signal is provided on pin 10 and the transmitted signal is provided on pin 11. Each module (22, 24 and 26) is coupled by a decoupling network to the voltage supply +5 and to ground, respectively. Signals from a communication channel (not shown) are received via connector 22 and amplified by module 24. Texas Instruments
) driver module part number 75176 is suitable as a driver module. Signals from module 24 are sent to module 26.

モジュール2.6は排他的ORモジュールであり、Te
xas Instrments社製のモジュール部品番
号74LS86によって実現できる。
Module 2.6 is an exclusive OR module and Te
This can be achieved by a module part number 74LS86 manufactured by XAS Instruments.

管理者キーロック28は、レバー・スイッチ30によっ
て検出され、導線32を介してマイクロコントローラの
ピン03に送られる。マイクロコントローラは、背景モ
ードからキーロック・スイッチを走査する。水晶34は
、導線を介してマイクロコントローラのピン18および
19に結合されている。同様に、ウォッチドッグ・モジ
ュール36が、マイクロコントローラのピン04および
09に結合されている(水晶34は割込みソースではな
く、ウォッチドッグ回路36はマイクロコントローラを
リセットするために使用される。)警告音発生装置38
は、内部タイマ割込みによって制御され、モジュール4
0を介してマイクロコントローラ12のピン01および
02に結合されている。モジュール40は、高電流ドラ
イバであり、ネットワーク42を介して電流を警告音発
生装置に供給する。どのオフザシエルフ高電流ドライバ
・モジュールもモジュール40に使用できる。本発明の
好ましい実施例では、TexasInsturment
s社(TI)製のモジュール部品番号75451を使用
する。
The administrator keylock 28 is detected by a lever switch 30 and sent via lead 32 to pin 03 of the microcontroller. The microcontroller scans the keylock switch from background mode. Crystal 34 is coupled via conductive wires to pins 18 and 19 of the microcontroller. Similarly, a watchdog module 36 is coupled to pins 04 and 09 of the microcontroller (crystal 34 is not an interrupt source; watchdog circuit 36 is used to reset the microcontroller). Generator 38
is controlled by an internal timer interrupt and module 4
0 to pins 01 and 02 of the microcontroller 12. Module 40 is a high current driver and provides current to the alarm generator via network 42. Any off-the-shelf high current driver module can be used for module 40. In a preferred embodiment of the invention, the Texas Instrument
The module part number 75451 manufactured by S Company (TI) is used.

マイクロコントローラ12のピン3oおよび32ないし
39は、スタティックRA M 41およびラッチ44
をマイクロコントローラに相互接続するために使用され
る。RAM41およびラッチ44はどちらも通常の装置
であり、詳細は説明しない。スタティックRAMとラッ
チは、共通のデータ線に接続されている。この構成では
、RAMのアドレスは最初それらの線に出力され、ラッ
チ44にラッチされる。バス上に出力されるアドレスを
ラッチ・アップした後、データは次にRAMに送られる
Pins 3o and 32-39 of microcontroller 12 are connected to static RAM 41 and latch 44.
used to interconnect the microcontroller. Both RAM 41 and latch 44 are conventional devices and will not be described in detail. Static RAM and latches are connected to a common data line. In this configuration, the RAM address is first output on those lines and latched into latch 44. After latching up the address output on the bus, the data is then sent to RAM.

マイクロコントローラは、背景モードからキーボード・
アセンブリ46を走査する。キーボード・アセンブリは
、4−16デコーダ・モジュール48を経てマイクロコ
ントローラのピン25−28に結合されている。キーボ
ード46からのリターン信号は、抵抗性ネットワークR
Aを経てマイクロコントローラのピン21−24に送ら
れる。本発明の好ましい実施例で後はど説明するように
、キー・ストロークを監視するコードは、コントローラ
の背景レベルで実行される。割込みが発生するたびに、
プロセッサは一時的にこのコードから分岐して割込みに
サービスする。キーボードのLED部分はLEDドライ
バ・モジュール50を経てマイクロコントローラのピン
06.07.08および14に送られる。第1図に図示
してないもう一つの割込みソースは、内部ソースによっ
て引き起こされる割込みである。そのような内部ソース
は、タイマかも知れない。一般に、タイマは特定の時間
間隔で割込みを発生するようにセットされている。ある
時間間隔が経過すると、タイマは直ちに割込みを発生し
、マイクロコントローラはそのとき実行中のコードから
強制的に分岐させられて新しい事象を調べる。通常、マ
イクロコントローラは、新しい事象にサービスするため
の一組の新しいコードを実行しなければならない。
The microcontroller can access the keyboard from background mode.
Scan assembly 46. The keyboard assembly is coupled to pins 25-28 of the microcontroller via a 4-16 decoder module 48. The return signal from the keyboard 46 is connected to the resistive network R
A to pins 21-24 of the microcontroller. As explained later in the preferred embodiment of the invention, the code that monitors keystrokes is executed at the background level of the controller. Every time an interrupt occurs,
The processor temporarily branches from this code to service the interrupt. The LED portion of the keyboard is routed through the LED driver module 50 to pins 06.07.08 and 14 of the microcontroller. Another interrupt source not shown in FIG. 1 is an interrupt caused by an internal source. Such an internal source may be a timer. Generally, timers are set to generate interrupts at specific time intervals. Once a certain time interval has elapsed, the timer immediately generates an interrupt, forcing the microcontroller to branch from the then executing code to examine the new event. Typically, the microcontroller must execute a new set of code to service the new event.

第2図に、マイクロプロセッサと、それによって制御さ
れる事象または入出力装置の概念図を示す。これらの入
出力装置のあるものは、割込みレベルでの対応が必要で
ある。本発明の説明を簡単にするため、第1図の要素と
共通する第2図の要素は同じ参照番号で表わす。参照番
号12は、背景コードを実行中のマイクロプロセッサを
表わす。
FIG. 2 shows a conceptual diagram of a microprocessor and the events or input/output devices controlled by it. Some of these input/output devices require support at the interrupt level. To simplify the description of the invention, elements in FIG. 2 that are common to elements in FIG. 1 are designated by the same reference numerals. Reference number 12 represents the microprocessor running the background code.

前述のように、背景コードは、キーボード46、LED
45、管理者キーロック28およびRAM41を監視す
るために使用される。割込みを提出してマイクロプロセ
ッサを強制的に分岐させることができるソースは、直列
通信チャネル22、内部タイマ割込み52(警告音発生
装置38の音発生信号を含む)および磁気ストライプ読
取装置14からの磁気ストライプ・データである。これ
らの割込みは、背景コードとは非同期であ、ることに注
意すべきである。割込みが非同期なのは、どの入出力装
置をいつでもその割込み要求線を付勢できるためである
。さらに、これらの割込みの要求線のどれかがいつ付勢
されるかを、マイクロプロセッサは予測できない。
As mentioned above, the background code includes the keyboard 46, the LED
45, used to monitor the administrator key lock 28 and RAM 41. Sources that can submit interrupts to force the microprocessor to branch include the serial communication channel 22, internal timer interrupts 52 (including the tone generator 38), and the magnetic stripe reader 14. This is striped data. Note that these interrupts are asynchronous to the background code. Interrupts are asynchronous because any input/output device can have its interrupt request line activated at any time. Furthermore, the microprocessor cannot predict when any of these interrupt request lines will be asserted.

第3図は割込み要求を処理するための簡単な手法の概念
を示すフローチャートである。割込み要求は本来非同期
であるので、優先順位が同じ2つ以上の割込み要求が同
じ時間間隔中にサービスを必要とすることが避けられな
い。要するに、プロセッサが一度割込み要求を受諾して
、その割込みにサービスするためのコードの実行を開始
すると、そのコードの処理を終了するまでは別の割込み
を受諾することはない。新しい割込み要求は、待ち行列
化されて、サービスを待つ。この状況を第3図に示す。
FIG. 3 is a flowchart conceptually illustrating a simple technique for handling interrupt requests. Since interrupt requests are asynchronous in nature, it is inevitable that two or more interrupt requests with the same priority will require servicing during the same time interval. In short, once a processor accepts an interrupt request and begins executing code to service that interrupt, it will not accept another interrupt until it has finished processing that code. New interrupt requests are queued and wait for service. This situation is shown in Figure 3.

「背景レベルJと記した欄は、背景コード(すなわち、
優先順位の低いコード)が実行されているレベルを表わ
す、「割込みレベル」と記した第2の欄は、割込み要求
にサービスするためのレコードが実行されているレベル
を表わす。
``The column marked Background level J is the background code (i.e.
The second column labeled "Interrupt Level" represents the level at which the records for servicing interrupt requests are being executed.

このレベルは、前景レベルとも呼ばれる。「スタック」
と記した第3の欄は、割込み要求が受諾されるたびにマ
イクロプロセッサがプログラム・アドレスを転送する記
憶域を表わす。言い換えれば、プロセッサが分岐するた
びに、分岐前のプログラム中の次の順位アドレスが、ス
タック上に記憶される。アドレスは、プログラム・カウ
ンタ(pc)に保持される。プログラム・カウンタの内
容をスタック上に記憶することにより1割込みにサービ
スするコードの実行を終了すると、プロセッサは、割込
みが発生したとき実行中であったプログラム中の次の順
次アドレスから再開できる。最後に、第3図の矢印の方
向は、プログラムの流れの方向を示す。
This level is also called the foreground level. "stack"
The third column, labeled , represents the storage area to which the microprocessor transfers the program address each time an interrupt request is accepted. In other words, each time the processor branches, the next sequential address in the program before the branch is stored on the stack. The address is held in the program counter (pc). Upon finishing execution of the code that services an interrupt by storing the contents of the program counter on the stack, the processor can resume at the next sequential address in the program that was being executed when the interrupt occurred. Finally, the direction of the arrow in FIG. 3 indicates the direction of program flow.

すなわち、矢印52は、割込み要求1が矢印54で発生
したとき、プロセッサは背景レベルでコードを実行中で
あることを示す。割込み要求1は8051ハードウエア
によって検出される。プロセッサは割込み時に処理して
いた背景命令を終了する(ブロック56)。矢印58で
示すように、プログラム制御権が背景レベルから割込み
レベルに移る。言い換えれば、ブロック60で、プログ
ラムは背景コードから分岐してサービス・ルーチン1の
コードを実行する。さらに、矢印62で示すように、プ
ログラム・カウンタ(pc)内の背景アドレスがスタッ
ク上に置かれる。矢印64で示すように、矢印62で背
景アドレスをスタックする前にスタックが空になってい
たことに注意すべきである。
That is, arrow 52 indicates that the processor is executing code at background level when interrupt request 1 occurs at arrow 54. Interrupt request 1 is detected by the 8051 hardware. The processor finishes the background instruction it was processing at the time of the interrupt (block 56). As indicated by arrow 58, program control is transferred from the background level to the interrupt level. In other words, at block 60, the program branches from the background code to execute the code of Service Routine 1. Additionally, the background address in the program counter (pc) is placed on the stack, as indicated by arrow 62. It should be noted that the stack was empty before stacking the background address at arrow 62, as indicated by arrow 64.

ブロック60でサービス・ルーチン1の実行中に割込み
要求2(矢印66)が検出された場合は、サービス・ル
ーチン1のコードの実行が終了するまで割込み要求また
は遅延される。プログラムは次にブロック68に下りる
。ブロック68で、プログラムは“Return fr
om Interrupt”(RETI)と呼ばれる命
令を実行する。これは8051の標準命令なので詳細は
示さない。この命令が実行する機能はブロック70で示
されると1゛うだけに留めておく。要するに、割込み要
求2を処理するためのサービス・ルーチンに制御権が移
る。割込み要求2にサービスするコードの実行が終了す
ると、プログラムはブロック72に下りる。ブロック7
2で、プログラムはRETI命令を実行する。これによ
り、矢印74で示すようにプログラムの制御権が背景レ
ベルに戻る。この命令はまた矢印62でスタックされた
背景アドレスを取り出し、それをプログラム・カウンタ
に再ロードし、矢印76で示すようにスタックを空にす
る。ブロック78で示すように、プログラムは背景コー
ドの処理を続行する。
If interrupt request 2 (arrow 66) is detected during execution of service routine 1 at block 60, the interrupt is requested or delayed until execution of the code of service routine 1 is completed. The program then descends to block 68. At block 68, the program returns “Return fr
om Interrupt" (RETI). Since this is a standard 8051 instruction, we will not show the details. The function that this instruction performs is only 1" as shown in block 70. In short, interrupt Control is transferred to the service routine for servicing request 2. When the code servicing interrupt request 2 has finished executing, the program descends to block 72.Block 7
At 2, the program executes the RETI instruction. This returns control of the program to the background level, as indicated by arrow 74. This instruction also takes the stacked background address at arrow 62, reloads it into the program counter, and empties the stack as shown at arrow 76. The program continues processing the background code, as indicated by block 78.

第3A図は、第3図に概略を示した処理ステップのタイ
ミング・ダイヤグラムである。このタイミング・ダイヤ
グラムは、第3図の簡明な手法がもたらす問題を理解す
るのに役立つ。グラフから理解できるように、割込み1
が検出されると、直ちに割込みにサービスするためのコ
ード(サービス1)が開始される。しかし、割込み2の
サービスはそれが始まるまで時間Tだけ遅延される。割
込み要求を認識してから割込みの処理が実際に始まると
きまでに貴重なデータが失なわれる可能性があるので、
この遅延は許容できない。
FIG. 3A is a timing diagram of the processing steps outlined in FIG. This timing diagram helps understand the problem posed by the simple approach of FIG. As you can understand from the graph, interrupt 1
As soon as the interrupt is detected, the code for servicing the interrupt (Service 1) is started. However, the servicing of interrupt 2 is delayed by a time T until it begins. Valuable data may be lost between the time an interrupt request is acknowledged and the interrupt processing actually begins.
This delay is unacceptable.

第4図は、本発明の教示にもとづいて割込みを処理する
ための概念的手法を示す。この改善された方法では、プ
ロセッサが既に最初の要求にサービス中であるとき、第
2の要求との間に遅延はない。要するに、プロセッサが
最初の割込み要求を受け取るとき、その要求にサービス
するためのコードが背景レベルで実行される。プログラ
ムが背景モードで動作している場合、ハードウェアによ
ってセットされたフラッグ等の標識はすべてクリアされ
、したがってプロセッサは同じレベルの割込み要求を自
由に受諾できる。第3図と同様に、第4図は割込みにサ
ービスするためのプログラムが、背景レベルまたは割込
みレベルで実行できることを示す。プロセッサが背景レ
ベルでのコードの実行から分岐して割込みレベルでコー
ド実行するとき、プログラム・カウンタの内容がPCス
タック上に記憶される。
FIG. 4 illustrates a conceptual approach to handling interrupts in accordance with the teachings of the present invention. In this improved method, there is no delay between the second request when the processor is already servicing the first request. In short, when a processor receives the first interrupt request, the code to service that request is executed at the background level. When a program is running in background mode, any indicators set by the hardware, such as flags, are cleared, so the processor is free to accept interrupt requests of the same level. Similar to FIG. 3, FIG. 4 shows that the program for servicing interrupts can run at background level or interrupt level. When the processor branches from executing code at the background level to execute code at the interrupt level, the contents of the program counter are stored on the PC stack.

矢印77は、割込み要求1を検出したとき、プロセッサ
は背景レベルでコードを実行中であることを示す。割込
み要求1は割込みレベルで発生し、矢印79で示される
。割込み要求は8051のハードウェアによって検出さ
れる。ブロック80および矢印83は、プロセッサが処
理中の命令を終了して制御権をサービス・ルーチン1に
移すことを示す。矢印82で示すように、プログラム・
カウンタ内の背景アドレスが、スタック上に置かれる。
Arrow 77 indicates that the processor is executing code at background level when interrupt request 1 is detected. Interrupt request 1 occurs at the interrupt level and is indicated by arrow 79. Interrupt requests are detected by the 8051 hardware. Block 80 and arrow 83 indicate that the processor finishes processing the instruction and transfers control to service routine 1. As shown by arrow 82, the program
The background address in the counter is placed on the stack.

プロセッサは次に割込みレベルでブロック84にアクセ
スする。ブロック84で、プロセッサはサブルーチン“
Label 2”に対する呼出しを実行する(呼出し)
。ブロック84でこの命令を実行することにより、プロ
セッサは次の順次アドレスを背景アドレスの1番上のス
タック上に置く。
The processor then accesses block 84 at interrupt level. At block 84, the processor executes the subroutine “
Execute a call to “Label 2” (call)
. By executing this instruction at block 84, the processor places the next sequential address on the top stack of background addresses.

これは矢印86で表わされている。次の順次アドレスは
サービス・ルーチン1に対するアドレスであり、ブロッ
ク90に示されている。ブロック84に続いて、プロセ
ッサはブロック81に下りる。
This is represented by arrow 86. The next sequential address is for service routine 1 and is shown at block 90. Following block 84, the processor descends to block 81.

ブロック81で、プロセッサはRETI命令を実行する
。この命令により制御権が背景レベルに戻る。この命令
はまた矢印86で次の順次命令アドレスを取り出し、そ
れをプログラム・カウンタにロードする。したがって、
矢印92で背景アドレスのみがスタック上に残る。プロ
セッサに最初の割込みにサービスするためのコードを背
景レベルで強制的に実行させるには、ブロック84およ
び81の命令を図の順序で実行しなければならない。
At block 81, the processor executes a RETI instruction. This command returns control to the background level. This instruction also takes the next sequential instruction address at arrow 86 and loads it into the program counter. therefore,
At arrow 92 only the background address remains on the stack. To force the processor to execute the code to service the first interrupt at background level, the instructions in blocks 84 and 81 must be executed in the order shown.

指定された命令を図の順序で実行することにより、通常
、割込み要求が取り上げられるときにセットされる、使
用中のプロセッサの標識は全てクリアされ、このときプ
ロセッサは他の割込み要求を自由に受諾できる。
Executing the specified instructions in the order shown clears any busy processor indicators that would normally be set when an interrupt request is picked up, leaving the processor free to accept other interrupt requests. can.

ブロック84および81の命令は8o51の命令なので
、詳細は示さない。これらの命令についてもつと詳しい
情報を得たい場合は、8o51型マイクロコントローラ
と一緒に提供される資料を参考にするとよい。さらに、
別のマイクロプロセッサを使用したい場合は、プロセッ
サに割込みを背景レベルで強制的にサービスさせるため
に同様な命令を処理するものでなければならない。割込
みレベルから戻ってからプロセッサが入る最初のブロッ
クは、ブロック90である。ブロック90で、プロセッ
サは割込み要求1にサービスするコードの実行を開始す
る。このコードの実行中、矢印94で割込み要求2を受
け取る。プログラムは、ブロック96および矢印97に
下り、そこで処理中の命令を終了し、制御権をサービス
・ルーチン2に移す。同時に、矢印98で、プログラム
・カウンタ内のサブルーチン・アドレスが、背景アドレ
スの1番上のスタックに転送される。
The instructions in blocks 84 and 81 are 8o51 instructions and will not be shown in detail. If you would like more information about these instructions, please refer to the documentation provided with the 8o51 microcontroller. moreover,
If you wish to use another microprocessor, it must handle similar instructions to force the processor to service interrupts at background level. The first block the processor enters after returning from interrupt level is block 90. At block 90, the processor begins executing code that services interrupt request 1. During execution of this code, interrupt request 2 is received at arrow 94. The program descends to block 96 and arrow 97, which terminates the instruction being processed and transfers control to Service Routine 2. At the same time, at arrow 98, the subroutine address in the program counter is transferred to the top stack of background addresses.

矢印98のサービス・ルーチン・アドレスは、サービス
・ルーチン1内の、そこでプロセッサが割込み1にサー
ビスするためにサービス・ルーチン1の実行を続行する
位置である。≦い換えれば、矢印98のサブルーチン・
アドレスは、ブロック104のアドレスである。サービ
ス・ルーチン1からサービス・ルーチン2に制御権が移
った後、プロセッサはブロック100に入る。ブロック
100で、プロセッサはサービス・ルーチン2を実行す
る。サービス・ルーチン2は、割込み要求2をクリアす
るためにプロセッサが実行しなければならないコードで
ある。割込み要求2をクリアするためのコードの実行を
終了すると、プロセッサはブロック102に下りる。ブ
ロック102で。
The service routine address of arrow 98 is the location within service routine 1 at which the processor continues execution of service routine 1 to service interrupt 1. ≦In other words, the subroutine of arrow 98
The address is the address of block 104. After control is transferred from Service Routine 1 to Service Routine 2, the processor enters block 100. At block 100, the processor executes service routine 2. Service Routine 2 is the code that the processor must execute to clear Interrupt Request 2. Upon finishing executing the code to clear interrupt request 2, the processor returns to block 102. At block 102.

プロセッサは(RETI)命令を実行する。前と同様に
、(RETI)命令は制御権を背景コードに戻し、矢印
98のサブルーチン・アドレスをプログラム・カウンタ
に転送する。プロセッサは次にサービス・ルーチン1の
コードの実行を終了する。プロセッサは次にブロック1
06に下りる。
The processor executes the (RETI) instruction. As before, the (RETI) instruction returns control to the background code and transfers the subroutine address at arrow 98 to the program counter. The processor then finishes executing the code of Service Routine 1. The processor then blocks 1
Descend to 06.

ブロック106で、プロセッサは“5ub−routi
neReturn” (RET)命令を実行する。これ
は矢印108の背景アドレスを取り出してプログラム・
カウンタに移す、8051の通常の命令である。
At block 106, the processor
neReturn” (RET) instruction. This takes the background address of arrow 108 and returns it to the program.
This is a normal 8051 instruction that moves to the counter.

アドレスをスタックからプログラム・カウンタに転送す
る手順は、ブロック106およびこの説明全体を通して
“ポツプ・スタック”と呼ばれる。
The procedure for transferring addresses from the stack to the program counter is referred to as "pop stack" at block 106 and throughout this description.

プログラムはブロック106からブロック110に下り
、そこで背景コードの実行を続行する。このときスタッ
クは空であり、別の一連の割込みが新たに発生するまで
、プロセッサは背景レベルでコードの実行を継続するこ
とに注意すべきである。
From block 106, the program descends to block 110 where execution of the background code continues. Note that the stack is now empty and the processor continues executing code at background level until another set of new interrupts occurs.

第5図は、第4図に示した手順のタイミング・ダイヤグ
ラムを示す。このダイヤグラムから明らかなように、割
込み1と割込み2は1割込み2の処理を遅延させずに、
同じ割込みレベルで共存できる。言い換えれば、遅延を
許容できない割込み2は、割込み1のアクティビティの
如何にかかわらず直ちに処理される。
FIG. 5 shows a timing diagram of the procedure shown in FIG. As is clear from this diagram, interrupt 1 and interrupt 2 can be processed without delaying the processing of interrupt 1 and interrupt 2.
They can coexist at the same interrupt level. In other words, Interrupt 2, which cannot tolerate delay, is processed immediately regardless of the activity of Interrupt 1.

F1発明の詳細 な説明したように、本発明によれば第1の割込み要求が
あったときに、一旦割込みレベルでの処理に移行し、こ
のレベルで元の割込み前のレベルすなわち背景レベルで
第1の割込み要求へのサービスが行われるようにセット
アツプする。こののち処理は割込みレベルから背景レベ
ルに戻され、上述のサービスが行われるとともに、第1
の割込み要求のフラグがクリアされる。したがって、こ
の段階でさらに他の割込み要求を受け付けることができ
る。すなわち単一の割込みレベルで複数の割込み要求を
処理することができる。
As described in detail of the F1 invention, according to the present invention, when there is a first interrupt request, processing is temporarily transferred to the interrupt level, and at this level, processing is performed at the original pre-interrupt level, that is, at the background level. Set up so that one interrupt request is serviced. Processing is then returned from the interrupt level to the background level, the above-mentioned services are performed, and the first
The interrupt request flag is cleared. Therefore, other interrupt requests can be accepted at this stage. That is, multiple interrupt requests can be processed at a single interrupt level.

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

第1A図、第1B図、第1C図および第1D図は本発明
の教示を具体化したデータ処理システムの電気的ブロッ
ク・ダイヤグラム、第1図は第1A図〜第1D図の組合
せを示す図、第2図はプロセッサによって制御される同
期タスクの概念図。 第3図は割込みを処理するために用いられる簡明な方法
の機能的フローチャート、第3A図は第3図に示す方法
のタイミング・ダイヤグラム、第4A図および第4B図
は本発明の教示にもとづいて割込みを処理するための機
能的フローチャート、第4図は第4A図および第4B図
の組合せを示す図、第5図は第4A図および第4B図の
方法のタイミング・ダイヤグラムである。
1A, 1B, 1C and 1D are electrical block diagrams of a data processing system embodying the teachings of the present invention; FIG. 1 is a combination of FIGS. 1A-1D; , FIG. 2 is a conceptual diagram of a synchronous task controlled by a processor. 3 is a functional flowchart of a simplified method used to handle interrupts; FIG. 3A is a timing diagram of the method shown in FIG. 3; and FIGS. 4 is a combination of FIGS. 4A and 4B; and FIG. 5 is a timing diagram of the method of FIGS. 4A and 4B.

Claims (1)

【特許請求の範囲】 サービスを要求するソースからの第1の割込み要求を受
け付けるステップと、 プロセッサが上記第1の割込み要求があったときに現に
実行している命令に続く、次の順次的なコードに対する
アドレスを保管するステップと、上記第1の割込み要求
をサービスするためのコードが記憶されているアドレス
を特定するステップと、 このアドレスを保管するステップと、 プロセッサが第2の割込み要求を受け付けるように条件
付けるステップと、 上記第1の割込み要求をサービスするコードの実行を開
始するステップと、 上記第2の割込み要求を受け付けるステップと、上記第
1の割込み要求をサービスするコードの実行を中断する
ステップと、 上記第2の割込み要求をサービスするコードを実行する
ステップとを有し、 1の割込みレベル内で優先付けを行い、異なる緊急度の
複数の事象に対しプロセッサがサービスを行えるように
した割込み処理方法。
[Scope of Claims] The steps of: accepting a first interrupt request from a source requesting a service; storing an address for the code; identifying an address at which the code for servicing the first interrupt request is stored; storing the address; and causing the processor to accept the second interrupt request. starting execution of code servicing said first interrupt request; accepting said second interrupt request; and suspending execution of code servicing said first interrupt request. and executing code for servicing the second interrupt request, prioritizing within one interrupt level and allowing the processor to service multiple events with different degrees of urgency. Interrupt handling method.
JP61274260A 1985-12-31 1986-11-19 Interrupt processing Pending JPS62160537A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US06/815,434 US4792890A (en) 1985-12-31 1985-12-31 Method for resolving conflicts between interrupt sources sharing the same priority level
US815434 1997-03-11

Publications (1)

Publication Number Publication Date
JPS62160537A true JPS62160537A (en) 1987-07-16

Family

ID=25217775

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61274260A Pending JPS62160537A (en) 1985-12-31 1986-11-19 Interrupt processing

Country Status (3)

Country Link
US (1) US4792890A (en)
EP (1) EP0230512A3 (en)
JP (1) JPS62160537A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6444262B1 (en) 1999-04-14 2002-09-03 Tokyo Electron Limited Thermal processing unit and thermal processing method

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5155809A (en) * 1989-05-17 1992-10-13 International Business Machines Corp. Uncoupling a central processing unit from its associated hardware for interaction with data handling apparatus alien to the operating system controlling said unit and hardware
DE69114321T2 (en) * 1990-02-20 1996-07-18 Nec Corp Interrupt control device suitable for performing the interrupt interleaving function.
US5379390A (en) * 1990-08-22 1995-01-03 Eaton Corporation Rate/ratio determining apparatus
US5175853A (en) * 1990-10-09 1992-12-29 Intel Corporation Transparent system interrupt
JPH0540730A (en) * 1991-08-06 1993-02-19 Mitsubishi Electric Corp Micro computer
US5280628A (en) * 1992-01-15 1994-01-18 Nitsuko Corporation Interruption controlling system using timer circuits
CA2126174C (en) * 1993-06-30 2003-01-21 David Thielen Method and system for interrupt-responsive execution of communications protocols
US5954792A (en) * 1996-12-30 1999-09-21 Cadence Design Systems, Inc. Method for schedule validation of embedded systems
US6615092B2 (en) * 2001-03-05 2003-09-02 Dell Products L.P. Method, system and facility for controlling resource allocation within a manufacturing environment
BRPI0407098A (en) * 2003-01-31 2006-01-24 Noel Companies Travel Guard Gr Point-of-purchase process and apparatus
US7607133B2 (en) * 2004-02-11 2009-10-20 Arm Limited Interrupt processing control

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59103150A (en) * 1982-12-06 1984-06-14 Hitachi Ltd Microprogram control system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3866181A (en) * 1972-12-26 1975-02-11 Honeywell Inf Systems Interrupt sequencing control apparatus
US4006466A (en) * 1975-03-26 1977-02-01 Honeywell Information Systems, Inc. Programmable interface apparatus and method
US4382284A (en) * 1981-04-15 1983-05-03 Honeywell Inc. Command and residual priority control of loads
US4488227A (en) * 1982-12-03 1984-12-11 Honeywell Information Systems Inc. Program counter stacking method and apparatus for nested subroutines and interrupts

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59103150A (en) * 1982-12-06 1984-06-14 Hitachi Ltd Microprogram control system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6444262B1 (en) 1999-04-14 2002-09-03 Tokyo Electron Limited Thermal processing unit and thermal processing method

Also Published As

Publication number Publication date
EP0230512A3 (en) 1989-09-06
EP0230512A2 (en) 1987-08-05
US4792890A (en) 1988-12-20

Similar Documents

Publication Publication Date Title
US5210873A (en) Real-time computer system with multitasking supervisor for building access control or the like
EP0644487B1 (en) Scalable system interrupt structure for a multiprocessing system
US5606703A (en) Interrupt protocol system and method using priority-arranged queues of interrupt status block control data structures
US5469571A (en) Operating system architecture using multiple priority light weight kernel task based interrupt handling
US4972368A (en) Intelligent serial I/O subsystem
US7962913B2 (en) Scheduling threads in a multiprocessor computer
US4177513A (en) Task handling apparatus for a computer system
US5832262A (en) Realtime hardware scheduler utilizing processor message passing and queue management cells
JP3335172B2 (en) Data processing system and input / output processor for use therein
US3573855A (en) Computer memory protection
US5325536A (en) Linking microprocessor interrupts arranged by processing requirements into separate queues into one interrupt processing routine for execution as one routine
US4020471A (en) Interrupt scan and processing system for a data processing system
US6938103B2 (en) Universal serial bus transaction processing tasks scheduling method for computer system, involves assigning transaction to periodic queue head list with faster polling interval
JPS62160537A (en) Interrupt processing
EP0644489A2 (en) Method and apparatus for signalling interrupt information in a data processing system
CA1304513C (en) Multiple i/o bus virtual broadcast of programmed i/o instructions
US7624396B1 (en) Retrieving events from a queue
EP0511769A1 (en) Method and apparatus for processing interrupts in a computer system
US5463764A (en) Method and system for system debugging through a keyboard device driver
EP0052713B1 (en) A process management system for scheduling work requests in a data processing system
Smotherman A sequencing-based taxonomy of I/0 systems and review of historical machines
JPH07311686A (en) Computer system and method for generation and processing of system management interrupt in it
Livny et al. Making workstations a friendly environment for batch jobs
JP2752894B2 (en) File transfer device
Sinclair System design with single board microprocessor systems