JPH0784786A - Program execution control method - Google Patents

Program execution control method

Info

Publication number
JPH0784786A
JPH0784786A JP24999293A JP24999293A JPH0784786A JP H0784786 A JPH0784786 A JP H0784786A JP 24999293 A JP24999293 A JP 24999293A JP 24999293 A JP24999293 A JP 24999293A JP H0784786 A JPH0784786 A JP H0784786A
Authority
JP
Japan
Prior art keywords
subroutine
routine
sub
processing
program execution
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
JP24999293A
Other languages
Japanese (ja)
Inventor
Hiroyuki Ishikawa
博行 石川
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co 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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP24999293A priority Critical patent/JPH0784786A/en
Publication of JPH0784786A publication Critical patent/JPH0784786A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

(57)【要約】 【目的】 ノイズ・静電気等による暴走等の異常処理を
防止させることが可能なプログラム実行制御方法を実現
する。 【構成】 制御装置は、装置全体の制御並びにプログラ
ム実行処理を含む各種のデータ処理を行なうCPU11
と、メインルーチンプログラム、サブルーチンI、サブ
ルーチンII及びサブルーチンIIIからなるプログラムメ
モリ12と、演算処理中のデータを一時的に記憶するワ
ークメモリ13と、サブルーチンI、サブルーチンII及
びサブルーチンIIIからの全ての戻り番地を記憶するサ
ブルーチン別テーブル14とを備え、サブルーチン別テ
ーブル14に予めサブルーチンI、サブルーチンII及び
サブルーチンIIIからの戻り番地を全て記憶しておくと
ともに、サブルーチン処理を行なう前に、戻り番地がサ
ブルーチン別テーブル14に記憶されているかをチェッ
クし、戻り番地がサブルーチン別テーブル14に記憶さ
れていないときは異常動作によるサブルーチン呼出しと
してリセット等の処理を行なう。
(57) [Summary] [Purpose] To realize a program execution control method capable of preventing abnormal processing such as runaway due to noise or static electricity. [Constitution] The control device includes a CPU 11 for performing various data processing including control of the entire device and program execution processing.
And a program memory 12 composed of a main routine program, subroutine I, subroutine II and subroutine III, a work memory 13 for temporarily storing data during arithmetic processing, and all returns from subroutine I, subroutine II and subroutine III The sub-routine table 14 for storing addresses is provided, and all the return addresses from the sub-routine I, the sub-routine II and the sub-routine III are stored in the sub-routine table 14 in advance. It is checked whether the return address is stored in the table 14, and if the return address is not stored in the sub-routine table 14, processing such as reset is performed as a subroutine call due to an abnormal operation.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、プログラム実行制御方
法に係り、詳細には、プログラムの異常処理を防止可能
なプログラム実行制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program execution control method, and more particularly to a program execution control method capable of preventing abnormal processing of a program.

【0002】[0002]

【従来の技術】割込みとは、計算機がプログラム実行中
に発生した非同期的な、または例外的な事象に応答する
ため、実行中のプログラムを強制的に一時中断し、指定
されたルーチンに自動的に制御を移すことである。その
際、割込み時点で実行中のプログラムを後に再起動でき
るようにCPU状態を自動的に保存する。割込みの原因
は、ハードウェア要因かソフトウェア要因かによって分
類することができる。入出力動作の終了通知や各種装置
の故障の通知などはハードウェア要因によるものであ
り、制御プログラムの呼び出しや演算によるオーバーフ
ローなどはソフトウェア要因によるものである。また、
割込み発生の要因が割込み発生時点で実行中のプログラ
ムと関連があるか否かによって分類することもできる。
2. Description of the Related Art An interrupt is a computer that responds to an asynchronous or exceptional event that occurs during program execution, forcibly suspending the program being executed and automatically executing a specified routine. To transfer control to. At that time, the CPU state is automatically saved so that the program being executed at the time of the interruption can be restarted later. The cause of the interrupt can be classified according to whether it is a hardware factor or a software factor. The notification of the end of the input / output operation and the notification of the failure of various devices are due to the hardware factor, and the overflow due to the calling of the control program and the calculation are due to the software factor. Also,
It can also be classified by whether or not the factor of the interrupt occurrence is related to the program being executed at the time of the interrupt occurrence.

【0003】[0003]

【発明が解決しようとする課題】上記割込みの場合と同
様に、メインルーチン実行時に、特定の処理を実行可能
なサブルーチンを呼び出して実行し、サブルーチン処理
終了後、メインルーチンに戻ってメインルーチン処理を
継続する。ところが、ノイズ・静電気等による異常動作
によってサブルーチン呼び出しが行なわれるようなこと
があると、復帰先が特定できないこと等により暴走によ
る異常処理が発生してしまうことがある。すなわち、従
来のサブルーチン処理では、ノイズ・静電気等による異
常動作によってサブルーチン呼び出しが行なわれてしま
うことまでは考慮されておらず異常処理を防止すること
はできなかった。
Similar to the case of the above-mentioned interrupt, when the main routine is executed, a subroutine capable of executing a specific process is called and executed, and after the completion of the subroutine process, the process returns to the main routine to execute the main routine process. continue. However, if a subroutine is called due to an abnormal operation due to noise or static electricity, an abnormal process due to a runaway may occur due to an unspecified return destination. That is, in the conventional subroutine processing, it is not possible to prevent the abnormal processing because it is not taken into consideration that the subroutine is called due to an abnormal operation due to noise, static electricity or the like.

【0004】そこで本発明は、ノイズ・静電気等による
暴走等の異常処理を防止させることが可能なプログラム
実行制御方法を提供することを目的としている。
Therefore, an object of the present invention is to provide a program execution control method capable of preventing abnormal processing such as runaway due to noise, static electricity or the like.

【0005】[0005]

【課題を解決するための手段】本発明は、上記目的達成
のため、予め記憶されているルーチンに従って一連のプ
ログラムを実行する際のプログラム実行制御方法であっ
て、サブルーチンからメインルーチンに戻る際に、メイ
ンルーチン上におけるその戻り番地をチェックし、この
チェックした番地を、上記サブルーチンに対応して所定
のテーブルメモリ内に記憶されていた全ての戻り番地と
比較し、一致がない場合には、サブルーチンの異常実行
とみなして処理を終了するようにしている。
In order to achieve the above-mentioned object, the present invention is a program execution control method for executing a series of programs according to a routine stored in advance, which is provided when returning from a subroutine to a main routine. , The return address in the main routine is checked, the checked address is compared with all the return addresses stored in the predetermined table memory corresponding to the above subroutine, and if there is no match, the subroutine The process is terminated as if it was abnormally executed.

【0006】[0006]

【作用】本発明では、まず、テーブルメモリには予めサ
ブルーチンからの戻り番地を全て記憶されているものと
する。
In the present invention, first, it is assumed that all return addresses from the subroutine are previously stored in the table memory.

【0007】サブルーチン処理を行なうとき、サブルー
チンからメインルーチンに戻る際に、メインルーチン上
におけるその戻り番地がチェックされ、テーブルメモリ
内に記憶されていた全ての戻り番地と比較される。そし
て、その戻り番地がテーブルメモリ内に記憶されていた
戻り番地と一致すると通常にサブルーチンからメインル
ーチンに復帰させ、一致がない場合には、サブルーチン
の異常実行とみなして処理を終了(例えば、リセット)
させる。
When performing the subroutine processing, when returning from the subroutine to the main routine, the return address on the main routine is checked and compared with all the return addresses stored in the table memory. When the return address matches the return address stored in the table memory, the subroutine normally returns to the main routine, and if there is no match, it is regarded as abnormal execution of the subroutine and the processing ends (for example, reset). )
Let

【0008】したがって、ノイズ・静電気等による暴走
による異常処理を防止することができる。
Therefore, it is possible to prevent abnormal processing due to runaway caused by noise, static electricity or the like.

【0009】[0009]

【実施例】以下、図1〜図3を参照して実施例を説明す
る。
EXAMPLES Examples will be described below with reference to FIGS.

【0010】図1〜図3はプログラム実行制御方法の一
実施例を示す図であり、本実施例はプログラム実行制御
方法を制御装置に適用した例である。
1 to 3 are diagrams showing an embodiment of a program execution control method, and this embodiment is an example in which the program execution control method is applied to a control device.

【0011】先ず、構成を説明する。図1は制御装置の
ブロック図である。この図において、11は装置全体の
制御、並びに後述するプログラム実行処理を含む各種の
データ処理を行うCPU(Central Processing Unit)で
あり、CPU11は図示しないROMに格納されている
マイクロプログラムに従って制御装置の各種の動作を制
御する。CPU11には、メインルーチンプログラム、
サブルーチンI、サブルーチンII及びサブルーチンIIIか
らなるプログラムメモリ12と、演算処理中のデータを
一時的に記憶するワークメモリ13と、サブルーチン
I、サブルーチンII及びサブルーチンIIIからの全ての戻
り番地を記憶するサブルーチン別テーブル14とがそれ
ぞれ接続されている。
First, the structure will be described. FIG. 1 is a block diagram of the control device. In this figure, reference numeral 11 denotes a CPU (Central Processing Unit) that controls the entire apparatus and performs various data processing including program execution processing described later, and the CPU 11 of the control apparatus follows a microprogram stored in a ROM (not shown) Controls various operations. The CPU 11 has a main routine program,
A program memory 12 composed of a subroutine I, a subroutine II and a subroutine III, a work memory 13 for temporarily storing data being processed, and a subroutine
A sub-routine table 14 for storing all return addresses from I, sub-routine II and sub-routine III is connected to each.

【0012】サブルーチン別テーブル14は、予めサブ
ルーチンI、サブルーチンII及びサブルーチンIIIからの
戻り番地を全て記憶したテーブルである。
The sub-routine table 14 is a table in which all return addresses from the sub-routines I, II and III are stored in advance.

【0013】次に、本実施例の動作を説明する。Next, the operation of this embodiment will be described.

【0014】まず、本実施例のプログラム実行制御方法
のルーチンの基本的な流れを図2に示すフローチャート
に基づいて述べる。
First, the basic flow of the routine of the program execution control method of this embodiment will be described with reference to the flow chart shown in FIG.

【0015】いま、メインルーチン実行中にサブルーチ
ンコールがあると(ステップS1)、コールされたサブ
ルーチンに移行してそのサブルーチンを実行し(ステッ
プS2)、そのサブルーチン処理が終了するとサブルー
チンコールがあった時点のメインルーチンに復帰する
(ステップS3)。
If there is a subroutine call during the execution of the main routine (step S1), the process moves to the called subroutine and the subroutine is executed (step S2). When the subroutine processing ends, there is a subroutine call. To return to the main routine (step S3).

【0016】図3は上記サブルーチン処理を実行する際
のサブルーチンチェック処理のフローチャートである。
FIG. 3 is a flowchart of a subroutine check process when the above subroutine process is executed.

【0017】まずステップS11で現在における戻り番
地をチェックし、ステップS12で現在のサブルーチン
番号に対応したテーブル情報(戻り番地)を読み出す。
次いで、ステップS13でチェックした戻り番地と検出
したテーブル情報との一致をチェックし、ステップS1
4で戻り番地と検出したテーブル情報との一致があるか
否かを判別する。戻り番地と検出したテーブル情報との
一致があるときは正常なサブルーチン実行であると判断
してステップS15でサブルーチン処理を実行し、サブ
ルーチン処理終了後メインルーチンに復帰する。
First, the current return address is checked in step S11, and the table information (return address) corresponding to the current subroutine number is read in step S12.
Next, it is checked whether the return address checked in step S13 matches the detected table information, and step S1
In step 4, it is determined whether or not there is a match between the return address and the detected table information. When there is a match between the return address and the detected table information, it is determined that the subroutine is executed normally, the subroutine process is executed in step S15, and after the subroutine process is completed, the process returns to the main routine.

【0018】一方、戻り番地と検出したテーブル情報と
の一致がないときは異常動作によるサブルーチン呼び出
しであると判断してステップS16でリセット処理を行
なってメインルーチンの先頭へ復帰する。
On the other hand, when there is no match between the return address and the detected table information, it is determined that the subroutine is called due to an abnormal operation, reset processing is performed in step S16, and the process returns to the beginning of the main routine.

【0019】以上説明したように、本実施例の制御装置
は、装置全体の制御並びにプログラム実行処理を含む各
種のデータ処理を行なうCPU11と、メインルーチン
プログラム、サブルーチンI、サブルーチンII及びサブ
ルーチンIIIからなるプログラムメモリ12と、演算処
理中のデータを一時的に記憶するワークメモリ13と、
サブルーチンI、サブルーチンII及びサブルーチンIIIか
らの全ての戻り番地を記憶するサブルーチン別テーブル
14とを備え、サブルーチン別テーブル14に予めサブ
ルーチンI、サブルーチンII及びサブルーチンIIIからの
戻り番地を全て記憶しておくとともに、サブルーチン処
理を行なう前に、戻り番地がサブルーチン別テーブル1
4に記憶されているかをチェックし、戻り番地がサブル
ーチン別テーブル14に記憶されていないときは異常動
作によるサブルーチン呼出しとしてリセット等の処理を
行なっているので、ノイズ・静電気等による暴走による
異常処理を防止することができる。
As described above, the control device of this embodiment comprises the CPU 11 for controlling the entire device and various data processing including program execution processing, the main routine program, the subroutine I, the subroutine II and the subroutine III. A program memory 12 and a work memory 13 for temporarily storing data being processed,
The sub-routine table 14 for storing all return addresses from the sub-routine I, the sub-routine II and the sub-routine III, and storing all return addresses from the sub-routine I, the sub-routine II and the sub-routine III in advance in the sub-routine table 14 , Before the subroutine processing, the return address is table 1 by subroutine
4 is checked, and when the return address is not stored in the subroutine-specific table 14, reset processing is performed as a subroutine call due to abnormal operation, so abnormal processing due to runaway due to noise, static electricity, etc. is performed. Can be prevented.

【0020】なお、本実施例では、上記チェックルーチ
ンをサブルーチン処理の前に行なっているが、これに限
らず、サブルーチン処理の最後に行なってもよく、更に
はサブルーチン処理の前後で行なうようにしてもよい。
In the present embodiment, the above-mentioned check routine is performed before the subroutine processing, but the present invention is not limited to this, and it may be performed at the end of the subroutine processing, and may be performed before and after the subroutine processing. Good.

【0021】また、本実施例では、プログラム実行制御
方法を制御装置に適用した例であるが、これには限定さ
れず、予め記憶されているルーチンに従って一連のプロ
グラムを実行する際のプログラム実行制御方法であれば
どのような制御方法にも適用できることは言うまでもな
い。
Further, in the present embodiment, the program execution control method is applied to the control device, but the present invention is not limited to this, and the program execution control when executing a series of programs according to a routine stored in advance. It goes without saying that any control method can be applied as long as it is a method.

【0022】また、制御装置を構成する回路や素子、そ
の種類などは前述した実施例に限られないことは言うま
でもない。
Needless to say, the circuits and elements that make up the control device and the types thereof are not limited to those in the above-described embodiments.

【0023】[0023]

【発明の効果】本発明によれば、サブルーチンからメイ
ンルーチンに戻る際に、メインルーチン上におけるその
戻り番地をチェックし、このチェックした番地を、上記
サブルーチンに対応して所定のテーブルメモリ内に記憶
されていた全ての戻り番地と比較し、一致がない場合に
は、サブルーチンの異常実行とみなして処理を終了する
ようにしているので、ノイズ・静電気等による暴走等の
異常処理を防止することができる。
According to the present invention, when returning from the subroutine to the main routine, the return address on the main routine is checked and the checked address is stored in a predetermined table memory corresponding to the subroutine. Compared with all the return addresses that have been set, and if there is no match, it is considered as abnormal execution of the subroutine and the processing is terminated, so abnormal processing such as runaway due to noise or static electricity can be prevented. it can.

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

【図1】本発明に係るプログラム実行制御方法の一実施
例の制御装置のブロック構成図である。
FIG. 1 is a block configuration diagram of a control device of an embodiment of a program execution control method according to the present invention.

【図2】同実施例のルーチンの基本的な流れを示すフロ
ーチャートである。
FIG. 2 is a flowchart showing a basic flow of a routine of the same embodiment.

【図3】同実施例のサブルーチン処理を実行する際のサ
ブルーチンチェック処理のフローチャートである。
FIG. 3 is a flowchart of a subroutine check process when the subroutine process of the embodiment is executed.

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

11 CPU 12 プログラムメモリ 13 ワークメモリ 14 サブルーチン別テーブル 11 CPU 12 Program Memory 13 Work Memory 14 Subroutine Table

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 予め記憶されているルーチンに従って一
連のプログラムを実行する際のプログラム実行制御方法
であって、 サブルーチンからメインルーチンに戻る際に、メインル
ーチン上におけるその戻り番地をチェックし、 このチェックした番地を、上記サブルーチンに対応して
所定のテーブルメモリ内に記憶されていた全ての戻り番
地と比較し、 一致がない場合には、サブルーチンの異常実行とみなし
て処理を終了するようにしたことを特徴とするプログラ
ム実行制御方法。
1. A program execution control method for executing a series of programs according to a routine stored in advance, wherein the return address on the main routine is checked when returning from the subroutine to the main routine. The specified address is compared with all the return addresses stored in the specified table memory corresponding to the above subroutine, and if there is no match, it is considered as abnormal execution of the subroutine and the processing is terminated. And a program execution control method.
JP24999293A 1993-09-09 1993-09-09 Program execution control method Pending JPH0784786A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24999293A JPH0784786A (en) 1993-09-09 1993-09-09 Program execution control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24999293A JPH0784786A (en) 1993-09-09 1993-09-09 Program execution control method

Publications (1)

Publication Number Publication Date
JPH0784786A true JPH0784786A (en) 1995-03-31

Family

ID=17201232

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24999293A Pending JPH0784786A (en) 1993-09-09 1993-09-09 Program execution control method

Country Status (1)

Country Link
JP (1) JPH0784786A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003510684A (en) * 1999-09-20 2003-03-18 ギーゼッケ ウント デフリエント ゲーエムベーハー Methods for protecting program execution
KR100917370B1 (en) * 2005-11-30 2009-09-16 후지제롯쿠스 가부시끼가이샤 Information processing apparatus that executes program, computer readable medium in witch program is stored, and program control method for executing program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003510684A (en) * 1999-09-20 2003-03-18 ギーゼッケ ウント デフリエント ゲーエムベーハー Methods for protecting program execution
KR100917370B1 (en) * 2005-11-30 2009-09-16 후지제롯쿠스 가부시끼가이샤 Information processing apparatus that executes program, computer readable medium in witch program is stored, and program control method for executing program

Similar Documents

Publication Publication Date Title
EP1189137A1 (en) Interruption managing device and interruption managing method
US7752507B2 (en) Circuit arrangement and method for supporting and monitoring a microcontroller
EP0417916A2 (en) Procedure state descriptor system for digital data processors
JPS6136665B2 (en)
GB2030331A (en) Real-time Data Processing System for Processing Time Period Commands
JP2757768B2 (en) Database condition retrieval result inheritance method in conversation processing
JPH04205144A (en) Microprocessor
JP3185780B2 (en) System monitoring apparatus and method
JPH06282353A (en) Timer device having time shortening function
JP3008890B2 (en) Processing control unit
JPS6118045A (en) Detecting system of program runaway
JPS58142451A (en) Interruption control system
JPS59144955A (en) Information processor
JP2683274B2 (en) Function trace output method
JPS63109545A (en) Self-diagnostic system for hardware
JPH064356A (en) Abnormal operation detection method for software
JPH03208132A (en) Single chip microcomputer
JPS5935241A (en) Interruption control system
JPS5835648A (en) Program execution controlling system
JPH0573325A (en) Program load system
JPH02170239A (en) Input/output error processing system
JPH07334376A (en) Microprocessor and multitask management method
JPH0527963A (en) Simultaneous support method for different floating point arithmetic instructions
JPH07334391A (en) Information processing apparatus having transmission function and transmission monitoring method of the information processing apparatus
JPH04270441A (en) Data processor