JPH0497435A - Control system for exceptional treatment - Google Patents

Control system for exceptional treatment

Info

Publication number
JPH0497435A
JPH0497435A JP21559890A JP21559890A JPH0497435A JP H0497435 A JPH0497435 A JP H0497435A JP 21559890 A JP21559890 A JP 21559890A JP 21559890 A JP21559890 A JP 21559890A JP H0497435 A JPH0497435 A JP H0497435A
Authority
JP
Japan
Prior art keywords
exception handling
handling routine
etr
routine
exception
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
JP21559890A
Other languages
Japanese (ja)
Inventor
Kenji Hori
賢治 堀
Tomohiro Ekubo
江久保 智宏
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
NEC Solution Innovators Ltd
Original Assignee
NEC Corp
NEC Solution Innovators Ltd
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, NEC Solution Innovators Ltd filed Critical NEC Corp
Priority to JP21559890A priority Critical patent/JPH0497435A/en
Publication of JPH0497435A publication Critical patent/JPH0497435A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To eliminate relation between modules and to easily generate an exceptional treatment routine(ETR) by making it possible execute the temporary switching of the ETR. CONSTITUTION:When an exception is executed in a self-task, the ETR started by an exception interruption mechanism 16 is set up as a routine inherent in the task, and when the ETR has already been set up, the old ETR is saved and a new ETR is newly reset by an ETR setting means 13. When the application range of the ETR set up by the means 13 is completed, the ETR is released and the saved old ETR is restored by an ETR releasing means 14. Consequently, the ETR can be temporarily switched, relation between modules can be eliminated and the ETR can easily be generated.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は例外処理制御方式に関し、特に電子計算機シス
テムにおいて、タスクにて例外が発生した場合に起動さ
れる例外処理ルーチンの制御方式〔従来の技術〕 従来、タスク単位に使用する例外処理ルーチンは1タス
クに対し1つしか設定できず、複数の設定を行う場合に
も設定された1つの例外処理ルーチン内にて例外の判別
を行った後各々の例外処理ルーチンヘディスパッチされ
ていた。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to an exception handling control method, and particularly to a control method for an exception handling routine that is started when an exception occurs in a task in a computer system. [Technology] Conventionally, only one exception handling routine could be set for each task, and even when multiple settings were made, the exception handling routine would be used after determining the exception within the one exception handling routine that was set. Each exception handling routine was dispatched.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来の例外処理方式では、例外処理ルーチンの
処理は該例外処理ルーチンの適応範囲内に該タスクの実
行する全ての処理を意識して作成されなければならなが
った。
In the conventional exception handling method described above, the processing of the exception handling routine must be created with consideration to all the processing to be executed by the task within the applicable scope of the exception handling routine.

また、上位のモジュールでは下位のモジュールで例外処
理ルーチンが設定される事を意識し下位モジュールから
の復帰後は例外処理ルーチンを再設定する必要があった
Also, in the upper module, it was necessary to be aware that the exception handling routine was set in the lower module, and to reset the exception handling routine after returning from the lower module.

〔課題を解決するための手段〕[Means to solve the problem]

本発明の例外処理方式は、自タスクにて例外が発生した
ときに前記例外割り込み発生機構により起動される例外
処理ルーチンを該タスク固有のものとして設定し、既に
例外処理ルーチンが設定されている場合は旧例外処理ル
ーチンを退避し、新例外処理ルーチンを新たに再設定す
る例外処理ルーチン設定手段と、前記例外処理ルーチン
設定手段により設定された例外処理ルーチンの適応範囲
が終了したときに該例外処理ルーチンを解放し、退避さ
れた旧例外処理ルーチンを復帰する例外処理ルーチン解
放手段とを有している。
The exception handling method of the present invention sets an exception handling routine that is activated by the exception interrupt generation mechanism when an exception occurs in a self-task as unique to that task, and when an exception handling routine has already been set. is an exception handling routine setting means for saving the old exception handling routine and resetting a new exception handling routine, and when the application range of the exception handling routine set by the exception handling routine setting means ends, the exception handling routine is and exception handling routine release means for releasing the routine and restoring the saved old exception handling routine.

〔実施例〕〔Example〕

次に、本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は本発明の全体構成を示した図である。FIG. 1 is a diagram showing the overall configuration of the present invention.

第1図において、メインルーチン11はサブルーチン1
2をコールするプログラムであり、各ルーチンはそれぞ
れのルーチン独自の例外処理ルーチンを設定する。メイ
ンルーチン11は自ルーチン内にて例外か発生した場合
に起動される例外処理ルーチンを設定するために例外処
理ルーチン設定手段13を起動する。
In FIG. 1, main routine 11 is subroutine 1.
2, and each routine sets its own exception handling routine. The main routine 11 activates the exception handling routine setting means 13 in order to set an exception handling routine to be activated when an exception occurs within the main routine.

例外処理ルーチン設定手段13は例外処理ルーチンが既
に設定されているかチエツクを行い、例外処理ルーチン
の設定が行われていないのでメインルーチン11から指
定された例外処理ルーチンのエントリアドレスを記憶し
メインルーチン11に制御を戻す。サブルーチン12は
メインルーチン11からコールされると、同サブルーチ
ン12内にて使用する例外処理ルーチンを設定するため
に例外処理ルーチン設定手段13を起動する。例外処理
ルーチン設定手段13は例外処理ルーチンが設定されて
いるかチエツクを行い、メインルーチン11にて既に設
定済みであるので設定済み例外処理ルーチンのエントリ
アドレスを退避した後サブルーチン12から指定された
例外処理ルーチンのエントリアドレスを記憶しサブルー
チン12に制御を戻す。サブルーチン12は例外処理ル
ーチンの適応範囲が終了すると該例外処理ルーチンを解
放するために例外処理ルーチン解放手段14を起動する
The exception handling routine setting means 13 checks whether an exception handling routine has already been set. Since the exception handling routine has not been set, the exception handling routine setting means 13 stores the entry address of the exception handling routine designated by the main routine 11 and sets the exception handling routine to the main routine 11. Return control to. When the subroutine 12 is called from the main routine 11, it activates the exception handling routine setting means 13 to set an exception handling routine to be used in the subroutine 12. The exception handling routine setting means 13 checks whether an exception handling routine has been set.Since it has already been set in the main routine 11, the exception handling routine setting means 13 saves the entry address of the set exception handling routine, and then executes the exception handling specified by the subroutine 12. The entry address of the routine is stored and control is returned to the subroutine 12. The subroutine 12 activates the exception handling routine release means 14 to release the exception handling routine when the scope of application of the exception handling routine ends.

例外処理ルーチン解放手段14は現在設定されている例
外処理ルーチンを解放した後前記例外処理ルーチン設定
手段13により例外処理ルーチンのエントリアドレスが
退避されているかチエ・ツクを行い、例外処理ルーチの
エントリアドレスは退避されていないので、そのままメ
インルーチン11に処理を戻す。
After releasing the currently set exception handling routine, the exception handling routine release means 14 checks whether the entry address of the exception handling routine has been saved by the exception handling routine setting means 13, and saves the exception handling routine entry address. has not been saved, the process returns to the main routine 11 as is.

例外処理ルーチン適応範囲15処理中に例外が発生する
と例外割り込み機構16が動作し、例外処理ルーチンが
設定されているかチエツクを行う。この場合は対応した
例外処理ルーチンが設定されているので例外処理ルーチ
ンに制御を渡す。
Exception handling routine application range 15 When an exception occurs during processing, an exception interrupt mechanism 16 operates to check whether an exception handling routine has been set. In this case, since a corresponding exception handling routine has been set, control is passed to the exception handling routine.

第2図は本発明の一実施例のうち例外処理ルーチンを使
用するプログラムの構成を示した図である。第2図にお
いて、メインルーチン21はサブルーチン22をコール
し、サブルーチン22はサブルーチン23をコールする
。サブルーチン23は更にサブルーチン24をコールし
、各サブルーチンは各々のコーラ−に復帰する。
FIG. 2 is a diagram showing the structure of a program using an exception handling routine in one embodiment of the present invention. In FIG. 2, main routine 21 calls subroutine 22, and subroutine 22 calls subroutine 23. Subroutine 23 further calls subroutine 24, and each subroutine returns to its respective caller.

第3図から第5図は第2図に関連して制御構造体の関係
の推移を示した図である。制御構造体31は例外処理ル
ーチンエントリアドレス記憶エリアへのポインタ(以後
例外処理ポインタと略す)32と例外処理ルーチンを使
用するタスク34へのポインタ33が格納されている。
FIGS. 3 to 5 are diagrams showing the transition of the relationship between control structures in relation to FIG. 2. The control structure 31 stores a pointer 32 to an exception handling routine entry address storage area (hereinafter referred to as an exception handling pointer) and a pointer 33 to a task 34 that uses the exception handling routine.

例外処理ポインタ32は例外処理ルーチンが設定されて
いないときは例外処理ルーチンエントリアドレス記憶エ
リア35の最高位アドレスを指している。メインルーチ
ン21及びサブルーチン22〜24はそれぞれ各ルーチ
ン内にのみ対応する例外処理ルーチンを設定する。
The exception handling pointer 32 points to the highest address of the exception handling routine entry address storage area 35 when no exception handling routine is set. The main routine 21 and subroutines 22 to 24 each have a corresponding exception handling routine set only within each routine.

第4図はメインルーチン2]に対応した例外処理ルーチ
ン41を設定した後の状態を示した図である。
FIG. 4 is a diagram showing the state after setting the exception handling routine 41 corresponding to the main routine 2.

メインルーチン21は起動されると自ルーチン内に対応
する例外処理ルーチン41を設定するために前記例外処
理ルーチン設定手段13を起動する。例外処理ルーチン
設定手段13はポインタ32を低位方向にずらし、前記
メインルーチン21に対応する例外処理ルーチン41の
エントリアドレスをポインタ32′の示すエリア42に
格納する。この時点でメインルーチン21処理中に例外
が発生すると前記例外発生機構16はポインタ32′の
示すエリア42にニトリアドレスが格納されている例外
処理ルーチン41に制御を渡す。
When the main routine 21 is activated, it activates the exception handling routine setting means 13 in order to set the corresponding exception handling routine 41 within its own routine. The exception handling routine setting means 13 shifts the pointer 32 in the lower direction and stores the entry address of the exception handling routine 41 corresponding to the main routine 21 in the area 42 indicated by the pointer 32'. If an exception occurs during the processing of the main routine 21 at this point, the exception generating mechanism 16 transfers control to the exception handling routine 41 whose address is stored in the area 42 indicated by the pointer 32'.

第5図はメインルーチン21と同様にサブルーチン21
・23・24がコールされ各ルーチンに対応した例外処
理ルーチン5153・55のエントリアドレスを設定し
た状態である。この時点でサブルーチン24処理中に例
外が発生すると前記例外発生機構16はポインタ32゛
′の示すエリア56にエントリアドレスが格納されてい
る例外処理ルーチン55に制御を渡す。
FIG. 5 shows a subroutine 21 similar to the main routine 21.
・23 and 24 are called and the entry addresses of exception handling routines 5153 and 55 corresponding to each routine are set. If an exception occurs during the processing of the subroutine 24 at this point, the exception generating mechanism 16 transfers control to the exception handling routine 55 whose entry address is stored in the area 56 indicated by the pointer 32''.

サブルーチン24の例外処理ルーチン適応範囲が終了す
ると同サブルーチン24は前記例外処理ルーチン解放手
段14を起動する。例外処理ルーチン解放手段14はポ
インタ32′′の示すエリアに例外処理ルーチンのエン
トリアドレスか格納されているかチエツクを行い、現在
は例外処理ルーチン56のエントリアドレスか格納され
ているのて、同例外処理ルーチン56を解放するために
ポインタ32”を高位方向にずらす。
When the application range of the exception handling routine of the subroutine 24 ends, the subroutine 24 activates the exception handling routine release means 14. The exception handling routine releasing means 14 checks whether the entry address of the exception handling routine is stored in the area indicated by the pointer 32'', and since the entry address of the exception handling routine 56 is currently stored, the same exception handling routine is executed. To release routine 56, pointer 32'' is shifted upward.

サブルーチン24と同様にサブルーチン23・22とメ
インルーチン21が各々に対応した例外処理ルーチン5
3・51・41を解放すると第2図の初期状態に戻る。
Similar to the subroutine 24, the subroutines 23 and 22 and the main routine 21 correspond to each other in an exception handling routine 5.
When 3, 51, and 41 are released, the state returns to the initial state shown in FIG.

この時点でメインルーチン21の処理終了までの間に例
外が発生すると前記例外発生機構17はポインタ32が
例外処理ルーチンエントリ記憶エリアの最下位番地を示
しているので例外処理ルーチンが設定されていないと判
断し処理を終了する。
At this point, if an exception occurs before the processing of the main routine 21 ends, the exception generation mechanism 17 determines that no exception handling routine has been set because the pointer 32 indicates the lowest address of the exception handling routine entry storage area. Make a decision and end the process.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明の例外処理方式では、例外処
理ルーチンの一時的な切換を可能とすることにより、モ
ジュール間の関連を無くし、例外処理ルーチンの作成を
容易にするものである。
As described above, the exception handling method of the present invention enables temporary switching of exception handling routines, eliminates the relationship between modules, and facilitates the creation of exception handling routines.

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

第1図は本発明の全体構成を示す図、第2図は本発明の
一実施例のうち例外処理ルーチンを使用するプログラム
の構成を示す図、第3図から第5図は第2図に関連して
制御構造体の関係の推移を示す図である。 11・・・メインルーチン、12・・・サブルーチン、
13・・・例外処理ルーチン設定手段、14・・・例外
処理ルーチン設定手段、15・・・例外処理ルーチン適
応範囲、16・・・例外割り込み発生機構、21・・・
メインルーチン、22〜24・・・サブルーチン、31
・・制御構造体、32・32′ ・32°′・・・例外
処理ルーチンエントリへのポインタ、33・・・タスク
ポインタ、34・・・タスク、35・・・例外処理ルー
チンエントリ記憶エリア、41・・・メインルーチン2
]に対応する例外処理ルーチン、42・・・例外処理ル
ーチン41のエントリアドレス、51・・・サブルーチ
ン22に対応する例外処理ルーチン、52・・・例外処
理ルーチン51のエントリアドレス、53・・・サブル
ーチン23に対応する例外処理ルーチン、54・・・例
外処理ルーチン53のニトリアドレス、55・・・サブ
ルーチン24に対応する例外処理ルーチン、56・・・
例外処理ルーチン55のエントリアドレス。
Figure 1 is a diagram showing the overall configuration of the present invention, Figure 2 is a diagram showing the configuration of a program that uses an exception handling routine in one embodiment of the present invention, and Figures 3 to 5 are as shown in Figure 2. FIG. 4 is a diagram illustrating the transition of the relationship between control structures; 11...Main routine, 12...Subroutine,
13...Exception handling routine setting means, 14...Exception handling routine setting means, 15...Exception handling routine application range, 16...Exception interrupt generation mechanism, 21...
Main routine, 22-24...subroutine, 31
... Control structure, 32, 32', 32°'... Pointer to exception handling routine entry, 33... Task pointer, 34... Task, 35... Exception handling routine entry storage area, 41 ...Main routine 2
], 42... entry address of exception handling routine 41, 51... exception handling routine corresponding to subroutine 22, 52... entry address of exception handling routine 51, 53... subroutine Exception handling routine corresponding to 23, 54... Nitori address of exception handling routine 53, 55... Exception handling routine corresponding to subroutine 24, 56...
Entry address of exception handling routine 55.

Claims (1)

【特許請求の範囲】[Claims] 例外割り込み発生機構を有する電子計算機システムにお
いて、自タスクにて例外が発生したときに前記例外割り
込み発生機構により起動される例外処理ルーチンを該タ
スク固有のものとして設定し、既に例外処理ルーチンが
設定されている場合は旧例外処理ルーチンを退避し、新
例外処理ルーチンを新たに再設定する例外処理ルーチン
設定手段と、前記例外処理ルーチン設定手段により設定
された例外処理ルーチンの適応範囲が終了したときに該
例外処理ルーチンを解放し、退避された旧例外処理ルー
チンを復帰する例外処理ルーチン解放手段とを有し、例
外処理ルーチンの一時的な切換を行うことを特徴とする
例外処理制御方式。
In a computer system having an exception interrupt generation mechanism, an exception handling routine that is activated by the exception interrupt generation mechanism when an exception occurs in a self-task is set as unique to that task, and an exception handling routine is already set. If the exception handling routine is set by the exception handling routine setting means, the old exception handling routine is saved and a new exception handling routine is newly set. 1. An exception handling control method, comprising: exception handling routine release means for releasing the exception handling routine and restoring a saved old exception handling routine, and temporarily switching the exception handling routine.
JP21559890A 1990-08-15 1990-08-15 Control system for exceptional treatment Pending JPH0497435A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21559890A JPH0497435A (en) 1990-08-15 1990-08-15 Control system for exceptional treatment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21559890A JPH0497435A (en) 1990-08-15 1990-08-15 Control system for exceptional treatment

Publications (1)

Publication Number Publication Date
JPH0497435A true JPH0497435A (en) 1992-03-30

Family

ID=16675083

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21559890A Pending JPH0497435A (en) 1990-08-15 1990-08-15 Control system for exceptional treatment

Country Status (1)

Country Link
JP (1) JPH0497435A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016173746A (en) * 2015-03-17 2016-09-29 キヤノン株式会社 Information processing device, control method thereof and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016173746A (en) * 2015-03-17 2016-09-29 キヤノン株式会社 Information processing device, control method thereof and program

Similar Documents

Publication Publication Date Title
JPH0497435A (en) Control system for exceptional treatment
JPH04373026A (en) Program interrupting method
JPH01217635A (en) Register saving system
JPH02139630A (en) Online task exchange device
JP3079228B2 (en) Basic program execution method
JPH04181351A (en) Dynamic alteration system for sg information by command
JPH02178855A (en) Dead lock processing system for data base
JPH03163630A (en) Stack control method for processor
JP3697467B2 (en) Switch object update system
JPS6154542A (en) Task control system
JPS58155588A (en) Processing system of logical swap out
JPH0764802A (en) Simulation device for real-time system
JPS63245736A (en) Succeeding system for controller of exclusive control
JPS63131246A (en) Page release device
JPS63132340A (en) Execution control system in logical type language
JPH04284555A (en) Processor and processing method for executing outside ring transition
JPH05265846A (en) Memory managing system
JPH11312108A (en) System for replacing transaction synchronization of sub-load module
JPH0311431A (en) Overlay system
JPH05257887A (en) Program substitution system
JPH02300824A (en) Job interrupting/restarting control system in information processor
JPH0640312B2 (en) Program interface method
JPS6394339A (en) Virtual calculation system
JPH0681342B2 (en) Restart processing method
JPH0367357A (en) Multi-cpu system