JPH03166689A - Program checking method - Google Patents

Program checking method

Info

Publication number
JPH03166689A
JPH03166689A JP30834589A JP30834589A JPH03166689A JP H03166689 A JPH03166689 A JP H03166689A JP 30834589 A JP30834589 A JP 30834589A JP 30834589 A JP30834589 A JP 30834589A JP H03166689 A JPH03166689 A JP H03166689A
Authority
JP
Japan
Prior art keywords
program
ram
turned
sum check
memory
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
JP30834589A
Other languages
Japanese (ja)
Inventor
Tatsuya Nakamura
達哉 中村
Nobuhiko Fujii
信彦 藤井
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP30834589A priority Critical patent/JPH03166689A/en
Publication of JPH03166689A publication Critical patent/JPH03166689A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To securely check the contents of a program and to prevent the runa way due to program error by executing the sum check of the entire area of the program in a RAM and judging whether or not the program in the RAM is effective or ineffective. CONSTITUTION:When the power source is turned ON with a control switch turned OFF while the loading of the program to the RAM is incomplete, the contents of a memory for inspection are read in and the sum check value of the program in the RAM is calculated and compared with a sum check value in a memory for inspection. When the power source is turned ON with the control switch turned ON, the program is loaded in the RAM and the sum check value of the program in the RAM is calculated. The start address, size, and sum check value of the program in the RAM are written in the memory for inspection and the program in the RAM operates normally. When the power source is turned ON with the control switch turned OFF while the program loading to the RAM is complete, the program in the RAM begins to be executed. Consequently, the program is prevented from running away owing to a program error.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、アプリケーションソフトがRAM(書き込み
可能メモリ)上で動作する電子レジスタ、POSシステ
ム、NC制iII装置などに用いられているマイクロコ
ンピュータシステムのプログラムチェック方法に間する
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention is a program for a microcomputer system used in electronic registers, POS systems, NC-controlled III devices, etc. in which application software operates on RAM (writable memory). Please check the check method.

従来の技術 この種のマイクロコンピュータシステムにおいて、RA
MへプログラムロードをせずともRAMのプログラムを
実行させることのできる場合、このようなRAM上のプ
ログラムが有効であるか否かのチェックするためには、
電源投入後RAMへRAMのプログラムを読み込んだと
き特定のメモリに特定のパターンを書き込んでおき、次
にRAMへRAMのプログラムを読み込まなかった場合
は、該パターンのチェックをする方式を取ってきた。
Prior Art In this type of microcomputer system, RA
If it is possible to execute a program in RAM without loading the program into M, in order to check whether the program in RAM is valid or not,
A method has been adopted in which a specific pattern is written in a specific memory when the RAM program is read into the RAM after the power is turned on, and then the pattern is checked if the RAM program is not read into the RAM.

発明が解決しようとする課題 従来のこのようなメモリをチェックする方式では、RA
Mのプログラムを読み込み済みであるか否かのチェック
としては有効であるが、RAMのプログラムの内容を保
証することはできない。即ち特定のメモリの特定のパタ
ーンが正しく格納されていたとしても、他の部分が元の
値から変化している可能性があり、その場合、マイクロ
コンピュータシステムに大きな障害をもたらすことも考
えられる。
Problems to be Solved by the Invention In the conventional method of checking such a memory, the RA
Although this is effective in checking whether the M program has been loaded, it cannot guarantee the contents of the program in RAM. That is, even if a specific pattern in a specific memory is stored correctly, other parts may have changed from their original values, and in that case, it is conceivable that a major failure will occur in the microcomputer system.

本発明は、このような従来技術の課題に鑑み、プログラ
ムの内容を確実にチェックし、暴走を防ぐことの出来る
プログラムチェック方法を提供することを目的とする。
In view of the problems of the prior art, it is an object of the present invention to provide a program checking method that can reliably check the contents of a program and prevent runaway.

課題を解決するための手段 本発明は、ROM,RAM及び検査用メモリを具備し、
電源投入後前記ROMのプログラムが外部から前記RA
Mへプログラムを読み込む場合は、前記RAMのプログ
ラムへ制御を移した後前記RAMのプログラムが前記R
AMのプログラムのスタートアドレスとサイズとサムチ
ェック値とを前記検査用メモリに格納し、かつ電源投入
後前記ROMのプログラムが外部から前記RAMへプロ
グラムを読み込まない場合、前記ROMのプログラムが
前記検査用メモリ内の前記RAMのブOグラムのスター
トアドレスとサイズに基づき前記RAMのプログラムの
サムチェック値を計算し、前記検査用メモリ内のサムチ
ェック値と比較し、一致すれば前記RAMのプログラム
へ制御を移し、不一致であればエラーとすることを特徴
とするプログラムチェック方法である。
Means for Solving the Problems The present invention includes a ROM, a RAM, and a test memory,
After the power is turned on, the program in the ROM is transferred from the outside to the RA.
When reading a program into R, control is transferred to the program in the RAM, and then the program in the RAM is read into the R.
If the start address, size, and sum check value of the AM program are stored in the test memory, and the program in the ROM does not read a program from the outside into the RAM after power is turned on, the program in the ROM is stored in the test memory. A sum check value of the program in the RAM is calculated based on the start address and size of the program in the RAM in the memory, and is compared with the sum check value in the test memory. If they match, control is executed to the program in the RAM. This is a program check method characterized by transferring the data and determining an error if there is a mismatch.

作用 本発明は、上記のように、RAMのプログラムの全領域
のサムチェックをし、その結果、RAMのプログラムの
有効/無効を判断するので、たとえ一部のRAMのプロ
グラムの変化も確実に把えることができ、もしもサムチ
ェック値が一致しなければ、RAMのプログラムへ制御
を渡さずエラーとするので、プログラムの暴走などによ
りマイクロコンピュータシステムへ障害を与えるのを未
然に防ぐものである。
Operation As described above, the present invention performs a sum check on the entire area of the RAM program, and as a result, determines whether the RAM program is valid or invalid, so even if a portion of the RAM program changes, it can be reliably grasped. If the sum check values do not match, control is not passed to the program in the RAM and an error occurs, thereby preventing damage to the microcomputer system due to program runaway.

実施例 以下、本発明の実施例について図面を用いて説明する。Example Embodiments of the present invention will be described below with reference to the drawings.

第1図は、本発明のプログラムチェック方法の一実施例
を示すフローチャートである。
FIG. 1 is a flowchart showing an embodiment of the program checking method of the present invention.

この中で、ステップSl,  ステップS2、ステップ
S3、ステップS6、ステップS7、ステップS8はR
OM(読み取り専用メモリ)のプログラムで実行され、
ステップS4、ステップS5はRAMのプログラムで実
行される。
Among these, step Sl, step S2, step S3, step S6, step S7, and step S8 are R
It is executed by a program in OM (read-only memory),
Steps S4 and S5 are executed by a program in RAM.

(1)RAMへのプログラムロ一ドが未完の状態で制御
スイッチをOFF状態として電源ONとした場合:ステ
ップSlで制御スイッチを読み込み、ステップS2で制
御スイッチがオンかどうかを調べ、制御スイッチがオフ
なので、スチップS6で検査用メモリの内容を読み込み
、ステップS7でRAMのプログラムのサムチェック値
を計算する。そして、ステップS8で検査用メモリ内の
サムチェック値と比較する。そこでは当然に、サムチェ
ック不一致となりエラーとなる。なお、RAMのプログ
ラムのスタートアドレス及びサイズに一定の制限を設け
ておけば、その制限チェックによりエラーとすることも
可能である。
(1) When the power is turned on with the control switch in the OFF state with the program loading to the RAM incomplete: The control switch is read in step Sl, the control switch is checked to see if it is on in step S2, and the control switch is turned off. Since it is off, the contents of the test memory are read in step S6, and the sum check value of the program in the RAM is calculated in step S7. Then, in step S8, it is compared with the sum check value in the test memory. Naturally, the sum check will not match, resulting in an error. Note that if a certain limit is set on the start address and size of the program in the RAM, it is possible to detect an error by checking the limit.

(2)制御スイッチをON状態として電源ONとした場
合:ステップSt,  ステップS2と進み、制御スイ
ッチがオンなので、ステップS3において、RAMへプ
ログラムをロードする。そして、ステップS4において
、RAMのプログラムのサムチェック値を計算する。ス
テップS5において、RAMのプログラムのスタートア
ドレスとサイズとサムチェック値とを検査用メモリへ書
き込む。
(2) When the power is turned on with the control switch in the ON state: The process proceeds to step St and step S2, and since the control switch is on, the program is loaded into the RAM in step S3. Then, in step S4, the sum check value of the program in the RAM is calculated. In step S5, the start address, size, and sum check value of the program in the RAM are written into the test memory.

このようにして、RAMのプログラムは正常に動作する
。ここで、ステップS3のRAMへプログラムロードの
処理が通信回線を通じて行っており、時間を要すること
、回線使用料が高いことから、頻繁にこのプロセスを用
いることはできない。そこでステップS3のRAMへプ
ログラムロードの処理をせずどもRAMのプログラムを
実行させるため、上記のように、そのときの動作を保証
するための準備をステップS4及びステップS5で行な
っている。言うまでもなく、RAMは電池でバツクアッ
プされている。
In this way, the program in the RAM operates normally. Here, the process of loading the program into the RAM in step S3 is performed through a communication line, which requires time and the line usage fee is high, so this process cannot be used frequently. Therefore, in order to execute the program in the RAM without performing the process of loading the program into the RAM in step S3, preparations are made in steps S4 and S5 to guarantee the operation at that time, as described above. Needless to say, the RAM is backed up by a battery.

(3)RAMへのプログラムロ一ドが完了の状態で制御
スイッチをOFF状態として電#ONとした場合:第1
図のステップSl,  ステップS2、ステップS6、
ステップS7、ステップS8と進む。今度は、以前にス
テップS3、ステップS4、ステップS5が実行されて
いるので、ステップS8での判定は一致となり、RAM
のプログラムの実行に移ることができる。
(3) When the control switch is turned off and the power is turned on with the program loading to the RAM completed: 1st
Step Sl, step S2, step S6,
The process proceeds to step S7 and step S8. This time, since steps S3, S4, and S5 have been executed previously, the determination in step S8 is a match, and the RAM is
You can move on to executing the program.

第2図は、本発明の実施例で使用されるマイクロコンピ
ュータの一例のメモリ1のマップである。
FIG. 2 is a map of the memory 1 of an example of a microcomputer used in an embodiment of the present invention.

第2図から明らかなようにアプリケーションプログラム
に応じてメモリを増設するようになっている。上述のよ
うに、RAMのプログラムにより、サムチェツクする範
囲を指定するようになっているので、この様にサイズが
変更になってもROMのプログラムを変更する必要はな
い。
As is clear from FIG. 2, memory is expanded depending on the application program. As mentioned above, since the range to be sum checked is specified by the RAM program, there is no need to change the ROM program even if the size is changed in this way.

第3図は、本発明の実施例で使用される検査用メモリ2
の詳細である。4000Hから4002Hまでは、RA
Mのプログラムのスタートアドレス格納エリア、4 0
 0 2 Hから4004Hは、RAMのプログラムの
サイズ格納エリア、4004H〜4006Hは、サムチ
ェック値格納エリアである。
FIG. 3 shows the test memory 2 used in the embodiment of the present invention.
The details are as follows. From 4000H to 4002H, RA
M program start address storage area, 4 0
0 2 H to 4004H are RAM program size storage areas, and 4004H to 4006H are sum check value storage areas.

第3図のようにRAMのプログラムのスタートアドレス
及びRAMのプログラムのサイズに16の倍数という規
約を設け、各々2バイトのエリア(4000H−400
4H)に格納できるようにしている。この規約以外に、
例えば前者は2000H以下であること、後者は700
0H以上OE000以下、かつ1 00Hの倍数である
ことなどの規約を設けると、メモリのチェック機能をよ
り強固なものにすることができる。
As shown in Figure 3, the start address of the RAM program and the size of the RAM program are set as multiples of 16, and each area is 2 bytes (4000H-400H).
4H). In addition to this agreement,
For example, the former is 2000H or less, the latter is 700H.
By setting rules such as 0H or more and OE000 or less and a multiple of 100H, the memory checking function can be made more robust.

発明の効果 以上に述べたように、本発明は、RAMへのプログラム
ロードをせずともRAMのプログラムを実行させること
のできるコンピュータシステムにおいて、RAM上のプ
ログラムが有効か否かのチェックを確実なものとするこ
とができる。また、RAMのプログラムのサイズが変化
しても、RAMのプログラムを一部変更するだけでRO
Mを返ることなく対処できる。
Effects of the Invention As described above, the present invention provides a computer system that can execute a program in RAM without loading the program into RAM, and in which it is possible to reliably check whether or not the program in RAM is valid. can be taken as a thing. Also, even if the size of the RAM program changes, RO can be restored by simply changing a part of the RAM program.
You can deal with it without returning M.

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

第1図は、本発明のプログラムチェック方法の一実施例
を示すフローチャート、第2図は、同実施例に用いられ
るメモリマップ図、第3図は、同実施例に用いられる検
査用メモリの詳細を示す平面図である。 1・・・メモリマップ、2・・・検査用メモリ。
FIG. 1 is a flowchart showing an embodiment of the program checking method of the present invention, FIG. 2 is a memory map diagram used in the embodiment, and FIG. 3 is a detailed diagram of the test memory used in the embodiment. FIG. 1...Memory map, 2...Memory for inspection.

Claims (1)

【特許請求の範囲】[Claims]  ROM、RAM及び検査用メモリを具備し、電源投入
後前記ROMのプログラムが外部から前記RAMへプロ
グラムを読み込む場合は、前記RAMのプログラムへ制
御を移した後前記RAMのプログラムが前記RAMのプ
ログラムのスタートアドレスとサイズとサムチェック値
とを前記検査用メモリに格納し、かつ電源投入後前記R
OMのプログラムが外部から前記RAMへプログラムを
読み込まない場合、前記ROMのプログラムが前記検査
用メモリ内の前記RAMのプログラムのスタートアドレ
スとサイズに基づき前記RAMのプログラムのサムチェ
ック値を計算し、前記検査用メモリ内のサムチェック値
と比較し、一致すれば前記RAMのプログラムへ制御を
移し、不一致であればエラーとすることを特徴とするプ
ログラムチェック方法。
If the ROM is equipped with a ROM, a RAM, and a test memory, and the program in the ROM reads a program from the outside into the RAM after power is turned on, the program in the RAM reads the program in the RAM after transferring control to the program in the RAM. The start address, size, and sum check value are stored in the test memory, and after the power is turned on, the R
If the OM program does not read a program from the outside into the RAM, the ROM program calculates the sum check value of the RAM program based on the start address and size of the RAM program in the test memory, and A program check method characterized in that the sum check value in a test memory is compared with a sum check value, and if they match, control is transferred to the program in the RAM, and if they do not match, an error is determined.
JP30834589A 1989-11-27 1989-11-27 Program checking method Pending JPH03166689A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30834589A JPH03166689A (en) 1989-11-27 1989-11-27 Program checking method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30834589A JPH03166689A (en) 1989-11-27 1989-11-27 Program checking method

Publications (1)

Publication Number Publication Date
JPH03166689A true JPH03166689A (en) 1991-07-18

Family

ID=17979945

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30834589A Pending JPH03166689A (en) 1989-11-27 1989-11-27 Program checking method

Country Status (1)

Country Link
JP (1) JPH03166689A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09510030A (en) * 1994-02-23 1997-10-07 データフライト・ヨーロッパ・アクティー・セルスカブ Sales system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09510030A (en) * 1994-02-23 1997-10-07 データフライト・ヨーロッパ・アクティー・セルスカブ Sales system

Similar Documents

Publication Publication Date Title
KR930016880A (en) Electronic device and its fixing information
JPH03166689A (en) Program checking method
JPH01286029A (en) Microprogram patching system
JP3317361B2 (en) Battery backup control method for memory
JPS6111853A (en) Information processor
JPH04332055A (en) Method for detecting program runaway
JP3102568B2 (en) Software development equipment
JP3130798B2 (en) Bus transfer device
JP2978658B2 (en) Program development support device
JPH05342094A (en) Computer device
JP2506199B2 (en) Electronics
JPS63178357A (en) System starting-up method for computer system
EP0655686A1 (en) Retry control method and device for control processor
JPH0782460B2 (en) How to check the recording medium
JPH01286028A (en) Microprogram patching system
JPS62251833A (en) Computer system
JP2506591B2 (en) Auxiliary processor
JPS6231434A (en) Control system for instruction address
JPH01201728A (en) Program correcting system
JPH03208132A (en) Single chip microcomputer
JPS5842487B2 (en) Program loading method
JPS6269329A (en) Detecting system for breakage position of memory
JPH01195561A (en) Program loading system
JPH01246638A (en) Area error decision system for write instruction
JPH01158549A (en) Electronic device