JPS63278147A - Control system for preventing erroneous use of register - Google Patents

Control system for preventing erroneous use of register

Info

Publication number
JPS63278147A
JPS63278147A JP62114084A JP11408487A JPS63278147A JP S63278147 A JPS63278147 A JP S63278147A JP 62114084 A JP62114084 A JP 62114084A JP 11408487 A JP11408487 A JP 11408487A JP S63278147 A JPS63278147 A JP S63278147A
Authority
JP
Japan
Prior art keywords
register
instruction
error
invalid
circuit
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
JP62114084A
Other languages
Japanese (ja)
Inventor
Katsutoshi Muramatsu
勝利 村松
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP62114084A priority Critical patent/JPS63278147A/en
Publication of JPS63278147A publication Critical patent/JPS63278147A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To detect a program error in the initial stage to improve the reliability of software by providing each register with a circuit which indicates that the register can be used or the use of the register is inhibited and detecting whether the register can be used or not. CONSTITUTION:The usable/unusable state of each register 16 is freely set to an invalid state storage circuit 15 by a usable/unusable state change instruction 11. Consequently, the calling side can preliminarily inhibit the use of registers, which should not be used, in a module interface or the like by the usable/ unusable state change instruction 11. If a called module erroneously uses a register, the use of which is inhibited, because of a failure in interface, an error interrupt signal is outputted by an error detecting circuit 17. Since the program interrupt is caused, the program does not run away and the instruction of the interruption cause is checked to detect the error.

Description

【発明の詳細な説明】 〔概要〕 計算機に、各レジスタ毎に使用可能または使用禁止を指
示する回路を設け、レジスタを使用してよいのか悪いの
かを検出できる機構を設けることにより、モジュールイ
ンタフェースなどにおけるレジスタの誤った使用を防止
できるようにして。
[Detailed Description of the Invention] [Summary] By providing a circuit in a computer that instructs each register to be enabled or disabled, and by providing a mechanism that can detect whether a register is allowed or not to be used, module interfaces, etc. to prevent incorrect use of registers.

ソフトウェアの高信顧性を実現可能とする。It is possible to achieve high reliability of software.

〔産業上の利用分野〕[Industrial application field]

本発明は、命令によってデータをロード/ストアする複
数のレジスタを備えた計算機の命令制御回路に係り、特
に、プログラム誤りを早期に検出できるようにしたレジ
スタ誤使用防止制御方式に関するものである。
The present invention relates to an instruction control circuit for a computer equipped with a plurality of registers that load/store data according to instructions, and particularly relates to a register misuse prevention control system that enables early detection of program errors.

〔従来の技術〕[Conventional technology]

あるプログラムモジュールが、他のプログラムモジュー
ルを呼び出して、何らかの処理を依願する場合、所定の
レジスタにパラメータを設定して。
When a program module calls another program module and requests some processing, it sets parameters in a predetermined register.

依願内容を伝えることが行われている。このときに使用
するレジスタなどは2予めモジュールインタフェースと
して規定される。
The contents of the request are communicated. Registers and the like used at this time are defined in advance as a module interface.

このようなモジュールインタフェースにおいて。In such a module interface.

呼び出し側で、あるレジスタに何も設定していないにも
かかわらず、インタフェース・ミスによって、受は取り
側でそのレジスタを使用するなどの誤りをおかすことが
ある。同様に、サブルーチンの呼び出しの際にも、レジ
スタの使用誤りが生じやすく、処理の流れの中でも、設
定していないのに、レジスタを誤って使用することがよ
くある。
Even though the calling side has not set anything in a certain register, due to an interface error, the receiver may make a mistake such as using that register on the receiving side. Similarly, when a subroutine is called, register usage errors are likely to occur, and even during the flow of processing, registers are often used incorrectly even though they have not been set.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

レジスタを誤って使用すると、思いがけない位置でメモ
リ内容が破壊され、プログラムが暴走する原因となるこ
とがある。しかしながら、レジスタの使用誤りは、アセ
ンブル・エラーにはならないため、このような誤りを検
出することは極めて困難である。
Incorrect use of registers can corrupt memory contents in unexpected locations, causing the program to run out of control. However, since register usage errors do not result in assembling errors, it is extremely difficult to detect such errors.

本発明は上記問題点の解決を図り、命令実行に際して、
レジスタの使用誤りを検出できる手段を設けることによ
り、プログラム誤りを早期に検出できるようにし、ソフ
トウェアの信顧性を向上させることを目的としている。
The present invention aims to solve the above problems, and when executing instructions,
By providing means for detecting register usage errors, the purpose is to enable early detection of program errors and improve the reliability of software.

〔問題点を解決するための手段〕[Means for solving problems]

第1図は本発明の原理ブロック図である。 FIG. 1 is a block diagram of the principle of the present invention.

第1図において、10は命令をフェッチして実行する計
算機、11はレジスタの使用可否状態を変更する使用可
否状態変更命令、12はロード命令/ストア命令などの
レジスタ使用命令、13は命令をデコードする命令デコ
ーダ、14は使用可否状態変更命令11を実行する状態
変更命令実行回路、15は各レジスタの使用可否状態を
記t#するインバリッド状態記憶回路、16ばプログラ
ムで使用する汎用のレジスタ、17はレジスタ16の使
用誤りを検出するエラー検出回路を表す。
In FIG. 1, 10 is a computer that fetches and executes an instruction, 11 is an availability state change instruction that changes the availability state of a register, 12 is a register usage instruction such as a load instruction/store instruction, and 13 is an instruction decoded. 14 is a state change instruction execution circuit that executes the usability state change instruction 11; 15 is an invalid state storage circuit that records the usability state of each register; 16 is a general-purpose register used in the program; 17 represents an error detection circuit that detects an error in the use of the register 16.

本発明の場合、各レジスタ16に対応して、その使用可
否を示すインバリッド状態記憶回路15が設けられる。
In the case of the present invention, an invalid state storage circuit 15 is provided corresponding to each register 16 to indicate whether or not it can be used.

インバリッド状態記憶回路15が“0”を記憶するとき
、対応するレジスタ16は使用可とされ、“1”を記憶
するとき、使用不可とされる。
When the invalid state storage circuit 15 stores "0", the corresponding register 16 is enabled, and when it stores "1", it is disabled.

インバリッド状態記憶回路15への状態設定のために、
使用可否状態変更命令11が新設される。
In order to set the state to the invalid state storage circuit 15,
A usability state change command 11 is newly established.

この命令が命令デコーダ13によってデコードされると
、状態変更命令実行回路14によって、指定されたイン
バリッド状態記憶回路15への使用可否状態の設定がな
される。
When this instruction is decoded by the instruction decoder 13, the status change instruction execution circuit 14 sets the usability status of the specified invalid status storage circuit 15.

ロード/ストアなどのレジスタを使用するレジスタ使用
命令12が発行されると、命令デコーダ13を介して、
そのレジスタ使用信号がエラー検出回路17へ伝達され
る。エラー検出回路17は。
When a register usage instruction 12 that uses registers such as load/store is issued, the instruction decoder 13
The register use signal is transmitted to error detection circuit 17. The error detection circuit 17 is.

該当レジスタに対応するインバリッド状態記憶回路15
の使用可否状態をチェックし、このときインバリッド状
態記憶回路15が使用不可を示している場合には、エラ
ーの割込み信号を出力する。
Invalid state storage circuit 15 corresponding to the corresponding register
If the invalid state storage circuit 15 indicates that it cannot be used, an error interrupt signal is output.

〔作用〕[Effect]

インバリッド状態記憶回路15に対し、使用可否状態変
更命令11によって、自由に各レジスタの使用可否状態
を設定することができる。従って。
The usability state of each register can be freely set in the invalid state storage circuit 15 by the usability state change instruction 11. Therefore.

モジュールインクフェースなどにおいて、呼び出し側は
、使用されるべきでないレジスタに対し。
In module interfaces, etc., the caller may use registers that should not be used.

使用可否状態変更命令11によって、予め使用禁止とす
ることができる。呼び出されたモジュールが、インタフ
ェース・ミスにより、誤ってその禁止されているレジス
タを使用すると、エラー検出回路17によってエラー割
込み信号が出力され。
Use of the device can be prohibited in advance using the usability status change command 11. If the called module mistakenly uses the prohibited register due to an interface error, the error detection circuit 17 outputs an error interrupt signal.

プログラム割込みが起きるので、プログラムが暴走する
ことなく、その割込み原因となった命令を調べることに
より、直ちに誤りを見つけ出すことができることとなる
Since a program interrupt occurs, the error can be immediately found by examining the instruction that caused the interrupt, without causing the program to run out of control.

〔実施例〕〔Example〕

第2図は本発明の一実施例、第3図は使用可否状態の退
避/復元説明図、第4図は本発明の他の一実施例を示す
FIG. 2 shows one embodiment of the present invention, FIG. 3 is an explanatory diagram of saving/restoring the usability state, and FIG. 4 shows another embodiment of the present invention.

第2図において、20は呼び出し側のモジュール、21
は呼び出されるモジュール、ANDはアンド回路を表す
In FIG. 2, 20 is the calling module, 21
represents a called module, and AND represents an AND circuit.

モジュール(A)20において発行されているS I 
R(Set Invalid Register)命令
は、インバリッド状態記憶回路15のインバリッド表示
をONにする使用可否状態変更命令である。即ち。
S I issued in module (A) 20
The R (Set Invalid Register) command is a usability state change command that turns on the invalid display of the invalid state storage circuit 15. That is.

rsIR2Jの命令発行により、レジスタR2ニ対する
インバリッド状態記憶回路15のインバリッド表示がO
Nになる。以後、レジスタR2は使用禁止状態となる。
By issuing the command of rsIR2J, the invalid display of the invalid state storage circuit 15 for the register R2 becomes O.
Become N. Thereafter, register R2 is prohibited from use.

モジュール(A>20は、rL  1.PARM」のロ
ード命令により、レジスタR1にパラメータを設定し2
次のrL15.XJにより、モジュール(ABC)21
の先頭アドレスをレジスタR15に設定し、rBALR
14,15Jの分岐命令により、モジュール(ABC)
21を呼び出している。
Parameters are set in register R1 by the load command of module (A>20 is rL 1.PARM).
Next rL15. Module (ABC) 21 by XJ
Set the start address of rBALR in register R15,
14, 15J branch instruction, module (ABC)
Calling 21.

ここでモジュール(ABC)21が、第2図(イ)に示
すように、レジスタR1とレジスタR2とを間違えて、
rsT  2.XXXJのストア命令を出したとする。
Here, the module (ABC) 21 mistakes the register R1 and the register R2, as shown in FIG.
rsT 2. Assume that a store instruction for XXXJ is issued.

この場合、レジスタR2のインバリッド状態記憶回路1
5は“1”となっており、命令デコーダ13の出力であ
るレジスタR2使用信号との照合によって、エラー割込
み信号が出力されることになる。従って、直ちにレジス
タの使用誤りを検出することができる。
In this case, invalid state storage circuit 1 of register R2
5 is "1", and upon comparison with the register R2 use signal output from the instruction decoder 13, an error interrupt signal is output. Therefore, register usage errors can be detected immediately.

モジュール(ABC)21が、使用禁止状態となってい
るレジスタR2を、モジュール(A)20に対するイン
タフェースとは無関係の用途に使用したい場合には、第
2図(ロ)に示すように。
When the module (ABC) 21 wants to use the disabled register R2 for a purpose unrelated to the interface to the module (A) 20, as shown in FIG. 2(b).

レジスタを使用する前に、  S V R(Set V
alid Register)命令を発行する。このr
SVR2Jの命令を発行することにより、インバリッド
状態記憶回路15のインバリッド表示はOFFとなり。
Before using the register, set S V R (Set V
(alid Register) instruction. This r
By issuing the SVR2J command, the invalid display in the invalid state storage circuit 15 is turned off.

レジスタR2は使用可能状態となる。モジュール(AB
C)21は、使用するレジスタを意識してSVR命令を
出すので、このレジスタに関する使用誤りの心配はない
といえる。
Register R2 becomes available. Module (AB
Since C) 21 issues the SVR command with the register in mind, there is no need to worry about errors in the use of this register.

第2図に示す例では、1つのレジスタについてのみ、イ
ンバリッド表示のON10 F Fを行っているが、も
ちろん1命令でもって、複数レジスタのインバリッド表
示をON10 F Fさせることも可能である。この場
合5例えばレジスタ番号に対応するビットパターンによ
って複数レジスタを指定できるようにしてもよいし、ま
たはRR形式の命令によって、第1オペランドのレジス
タから第2オペランドのレジスタまでの連続したレジス
タ群に対し、インバリッド表示を0N10FFさせるよ
うにすることもできる。
In the example shown in FIG. 2, the invalid indication is turned ON10FF for only one register, but it is of course possible to turn the invalid indication of a plurality of registers ON10FF with one instruction. In this case, for example, multiple registers may be specified by a bit pattern corresponding to the register number, or an RR format instruction may be used to specify a continuous register group from the first operand register to the second operand register. , it is also possible to set the invalid display to 0N10FF.

例えば入出力割込みなどの割込みが発生した場合には、
オペレーティング・システムの割込みハンドラに制御が
移行され、それまで実行していたプログラムの実行が中
断される。このような場合。
For example, if an interrupt such as an input/output interrupt occurs,
Control is transferred to the operating system's interrupt handler, and execution of the previously executing program is interrupted. In such cases.

上記インバリッド状態記憶回路15が記憶するインバリ
ッド状態を退避/復元することが必要になると考えられ
る。
It is considered that it becomes necessary to save/restore the invalid state stored in the invalid state storage circuit 15.

これに対し2例えば第3図に示すように、使用可否状態
セーブ命令32および使用可否状態リストア命令34を
新設することにより対処することができる。第3図(イ
)に示すように、タスク30が走行しているときに2割
込みが発生したとする。これにより、予め登録した割込
みハンドラ31に制御が移行する。割込みハンドラ31
では。
This can be countered by newly providing a usability status save command 32 and a usability status restore command 34, for example, as shown in FIG. As shown in FIG. 3(a), it is assumed that two interrupts occur while task 30 is running. As a result, control is transferred to the interrupt handler 31 registered in advance. Interrupt handler 31
Well then.

汎用レジスタを所定の領域にセーブした後、使用可否状
態セーブ命令32を発行し、インバリッド状態記憶回路
15の内容を退避する。
After saving the general-purpose registers in a predetermined area, a usability state save instruction 32 is issued to save the contents of the invalid state storage circuit 15.

その後9割込み処理等が終了し、ディスパッチャ33に
より2元のタスク30に実行制御を戻す場合には、セー
ブしたレジスタをリストアし、また使用可否状態リスト
ア命令34によって、インバリッド状態記憶回路15の
内容を復元し9割込み地点へ制御を渡す。
After that, when the 9 interrupt processing etc. are completed and the dispatcher 33 returns execution control to the original task 30, the saved registers are restored and the contents of the invalid state storage circuit 15 are restored by the usability state restore instruction 34. Restore and pass control to the 9 interrupt point.

第4図は1本発明の他の一実施例によるインバリッド状
態の管理を示している。
FIG. 4 shows invalid state management according to another embodiment of the present invention.

第4図に示す例では、インバリッド状態記憶回路15に
相当するものとして、インバリッド状態表示レジスタ4
0が設けられている。インバリッド状態表示レジスタ4
0の先頭ビットから1ビツトずつ、順に各レジスタに対
応するインバリッド表示となっている。そして、このレ
ジスタ40に対する特別な書き込み命令として、WRI
TEインバリソド状態命令41が設けられ、このレジス
タ40からの読み出し命令として、READインハリソ
ド状態命令42が設けられている。
In the example shown in FIG. 4, an invalid state display register 4 corresponds to the invalid state storage circuit 15.
0 is set. Invalid status display register 4
Starting from the first bit of 0, each bit is displayed as invalid corresponding to each register in turn. Then, as a special write command to this register 40, WRI
A TE invalid status instruction 41 is provided, and a READ invalid status instruction 42 is provided as a read instruction from this register 40.

WtTEインバリッド状態命令41により。By WtTE invalid state instruction 41.

各レジスタに対応するインバリッド表示のセット/リセ
ットおよび復元が可能であり、READインハリソド状
態命令42により、インバリッド表示の退避が可能であ
る。なお1以上の命令に関する実行回路は、詳しく説明
するまでもなく、従来のロード/ストア命令などの実行
回路と同様に構成することができる。
It is possible to set/reset and restore the invalid indication corresponding to each register, and it is possible to save the invalid indication by the READ in-state command 42. Note that an execution circuit for one or more instructions need not be described in detail, and can be configured in the same manner as a conventional execution circuit for load/store instructions.

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

以上説明したように9本発明によれば、モジュールイン
タフェースやサブルーチン呼び出し等におけるレジスタ
使用誤りのインタフェース・ミスを防止することができ
、ソフトウェアの信頼性を向上させることができる。ま
た、レジスタの使用範囲を縮小/拡大することが可能に
なり1例えば下位のモジュールが使用できるレジスタを
、上位のモジュールが規定することなどにより、一般的
なレジスタの退避/復元などを一部のレジスタについて
省略可能にすることができる。
As described above, according to the present invention, it is possible to prevent interface errors due to incorrect use of registers in module interfaces, subroutine calls, etc., and it is possible to improve the reliability of software. In addition, it is now possible to reduce/expand the range of registers that can be used.1 For example, by allowing a higher-level module to specify the registers that can be used by a lower-level module, general register saving/restoring can be done in part. Registers can be made optional.

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

第1図は本発明の原理ブロック図、第2図は本発明の一
実施例、第3図は使用可否状態の退避/復元説明図、第
4図は本発明の他の一実施例を示す。 図中、10は計算機、11は使用可否状態変更命令、1
2はレジスタ使用命令、13は命令デコーダ、14は状
態変更命令実行回路、15はインバリッド状態記ta回
路、16はレジスタ、17はエラー検出回路を表す。
Fig. 1 is a block diagram of the principle of the present invention, Fig. 2 is an embodiment of the invention, Fig. 3 is an explanatory diagram of saving/restoring the usability state, and Fig. 4 is another embodiment of the invention. . In the figure, 10 is a computer, 11 is a usability state change command, 1
Reference numeral 2 represents a register use instruction, 13 an instruction decoder, 14 a state change instruction execution circuit, 15 an invalid state recording circuit, 16 a register, and 17 an error detection circuit.

Claims (1)

【特許請求の範囲】 命令によってデータをロード/ストアする複数のレジス
タを備えた計算機におけるレジスタ誤使用防止制御方式
であって、 上記各レジスタに対応してその使用可否状態を記憶する
インバリッド状態記憶回路(15)と、上記インバリッ
ド状態記憶回路(15)の記憶内容を更新し、使用可否
状態を変更する状態変更命令実行回路(14)と、 レジスタを使用する命令について、上記インバリッド状
態記憶回路(15)が記憶するそのレジスタの使用可否
状態をチェックし、使用不可である場合に命令エラーと
するエラー検出回路(17)とを備えたことを特徴とす
るレジスタ誤使用防止制御方式。
[Scope of Claims] A register misuse prevention control method in a computer equipped with a plurality of registers that load/store data according to instructions, comprising an invalid state storage circuit that stores the usability status of each register. (15), a state change instruction execution circuit (14) that updates the memory contents of the invalid state storage circuit (15) and changes the usability state; ), and an error detection circuit (17) that checks the usability status of the register stored in the register and determines an instruction error when the register is unusable.
JP62114084A 1987-05-11 1987-05-11 Control system for preventing erroneous use of register Pending JPS63278147A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62114084A JPS63278147A (en) 1987-05-11 1987-05-11 Control system for preventing erroneous use of register

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62114084A JPS63278147A (en) 1987-05-11 1987-05-11 Control system for preventing erroneous use of register

Publications (1)

Publication Number Publication Date
JPS63278147A true JPS63278147A (en) 1988-11-15

Family

ID=14628675

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62114084A Pending JPS63278147A (en) 1987-05-11 1987-05-11 Control system for preventing erroneous use of register

Country Status (1)

Country Link
JP (1) JPS63278147A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021149113A1 (en) * 2020-01-20 2021-07-29 富士通株式会社 Processor, simulator program, assembler program, and information processing program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021149113A1 (en) * 2020-01-20 2021-07-29 富士通株式会社 Processor, simulator program, assembler program, and information processing program

Similar Documents

Publication Publication Date Title
JPH1115675A (en) Interruption controller and control system
JPS63278147A (en) Control system for preventing erroneous use of register
JPH04332055A (en) Method for detecting program runaway
JP3130798B2 (en) Bus transfer device
JPH0258648B2 (en)
JPH0484224A (en) Stack area protection circuit
JPS63250753A (en) Memory access checking system
JPH0333939A (en) Microprocessor
JPH07244536A (en) Resume supporting mechanism
JPH07152594A (en) Retry control system for control processor
JPH0659941A (en) Information processor
JPH0113131B2 (en)
JPS63120336A (en) Switching system for memory access mode
JPH02148340A (en) System for controlling writing in control storage
JPS6168645A (en) Control system for instruction retrial
JPS6031650A (en) Computer
JPH04324567A (en) Method for preventing ipl volume contention between plural systems
JPH01295337A (en) Monitor routine control shift system
JPS6112585B2 (en)
JPS63168733A (en) Microprogram controller
JPS62278643A (en) Retrial control system
JPS6058491B2 (en) Error processing method
JPH03147130A (en) Operating system correcting system
JPS62231340A (en) Computer
JPS63129427A (en) Conversion circuit for interruption response logic