JPH031239A - Central processing unit - Google Patents

Central processing unit

Info

Publication number
JPH031239A
JPH031239A JP13531989A JP13531989A JPH031239A JP H031239 A JPH031239 A JP H031239A JP 13531989 A JP13531989 A JP 13531989A JP 13531989 A JP13531989 A JP 13531989A JP H031239 A JPH031239 A JP H031239A
Authority
JP
Japan
Prior art keywords
register
update information
update
saving
recovery
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
JP13531989A
Other languages
Japanese (ja)
Inventor
Junichi Shibuya
澁谷 純一
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
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP13531989A priority Critical patent/JPH031239A/en
Publication of JPH031239A publication Critical patent/JPH031239A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To evade unrequired recovery of a register and to prevent the register not being used at a call origin from being saved and recovered by executing the saving of the register at the call origin, executing the update of the register at a call destination, and furthermore, executing the recovery of the register at the call origin. CONSTITUTION:Register update information in which the presence/absence of the update of the content of the register is stored corresponding to each register is stored in an update information area 30. A register saving means 12 saves the current register update information to an external memory device 40 after saving the content of the register, and resets the register update information corresponding to a saved register. A register update information recording means 13 records the update of the register update information corresponding to an updated register. A register recovery means 14 recovers the content of the register having an update record to corresponding register update information out of designated registers, and resets the register update information corresponding to a recovered register. Thereby, it is possible to evade the unrequired recovery of the register.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、情報処理装置の中央処理装置に利用する。特
に、目的プログラムにおけるプログラム呼出しの際のレ
ジスタ退避回復に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention is applied to a central processing unit of an information processing device. In particular, it relates to saving and restoring registers when a program is called in the target program.

〔概要〕〔overview〕

本発明は中央処理装置において、 レジスタの内容の更新の有無を記録するレジスタ更新情
報を設け、プログラム呼出しの際の呼出し元によるレジ
スタの退避のために実行されるレジスタの退避命令では
退避されたレジスタに対応するレジスタ更新情報をリセ
ットし、呼出し先で実行されたレジスタの更新を行う命
令では更新されたレジスタに対応するレジスタの更新を
記録し、呼出し元で実行されるレジスタの回復命令では
回復すべきレジスタのうち対応するレジスタ更新情報に
更新が記録されているレジスタの内容を回復することに
より、 不要なレジスタの回復を回避できるようにしたものであ
る。
The present invention provides register update information for recording whether or not the contents of registers have been updated in a central processing unit, and when a register save instruction is executed to save registers by a caller when a program is called, registers that have been saved are The register update information corresponding to the register is reset, the register update information executed by the callee records the update of the register corresponding to the updated register, and the register recovery instruction executed by the caller records the update of the register. By restoring the contents of the registers whose updates are recorded in the corresponding register update information among the registers that need to be updated, it is possible to avoid restoring unnecessary registers.

〔従来の技術〕[Conventional technology]

従来、中央処理装置は、目的プログラムにおけるプログ
ラム呼出しの際のレジスタの退避の場合に、呼出し元と
呼出し先のレジスタの使用状況を互いに知る手段がない
ために、呼出し元で使用中のレジスタを退避回復するか
、または呼出し先で使用するレジスタを退避回復してい
た。
Conventionally, when saving registers when a program is called in a target program, the central processing unit saves the registers being used by the caller because there is no way to know the usage status of registers between the caller and the callee. or the registers used by the callee were saved and restored.

〔発明が解決しようとする問題点〕 しかし、このような従来の中央処理装置では、呼出し元
で退避回復する方法の場合には、呼出し先で破壊しない
レジスタの退避回復を行うことがあり、呼出し先で退避
回復する方法では呼出し元で使用していないレジスタの
退避回復を行う場合がある。このように呼出し元と呼出
し先とのレジスタの使用状況を互いに知る手段がないた
めに、本来は必要のないレジスタの退避回復を行う欠点
があった。
[Problems to be Solved by the Invention] However, in such conventional central processing units, when the caller saves and restores, the callee may save and restore registers that are not destroyed. In the method of saving and restoring first, registers that are not used by the caller may be saved and restored. As described above, since there is no means for the caller and the callee to mutually know the usage status of registers, there is a drawback that unnecessary registers are saved and restored.

本発明はこのような従来の欠点を解決するもので、不要
なレジスタの回復を回避することができる中央処理装置
を提供することを目的とする。
SUMMARY OF THE INVENTION The present invention solves these conventional drawbacks, and aims to provide a central processing unit that can avoid unnecessary register recovery.

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

本発明は、プログラムを格納する複数のレジスタと、指
定されたレジスタの内容を外部の記憶装置に退避する退
避手段と、指定されたレジスタの内容を上記記憶装置の
該当する内容で回復する回復手段と、レジスタ退避命令
に基づいて上記退避手段を起動する手段およびレジスタ
回復命令に基づいて上記回復手段を起動する手段を含む
命令実行手段とを備えた中央処理装置において、上記各
レジスタに対応してその内容の更新の有無を記録するレ
ジスタ更新情報を格納する更新情報領域と、更新された
レジスタに対応するレジスタ更新情報に更新を記録する
更新記録手段とを備え、上記命令実行手段は、レジスタ
更新命令に基づいて上記更新記録手段を起動する手段を
含み、上記退避手段は、レジスタの内容の退避終了後に
現在のレジスタ更新情報を上記記憶装置に退避しこの退
避したレジスタに対応するレジスタ更新情報をリセット
する手段を含み、上記回復手段は、上記レジスタ回復命
令で指定されたレジスタのうちの対応するレジスタ更新
情報に更新記録のあるレジスタの内容を回復しこの回復
したレジスタに対応するレジスタ更新情報をリセットす
る手段を含むことを特徴とする。
The present invention provides a plurality of registers for storing programs, a saving means for saving the contents of a specified register to an external storage device, and a recovery means for restoring the contents of the specified register with the corresponding contents of the storage device. and an instruction execution means including means for activating the saving means based on a register saving instruction and means for activating the recovery means based on a register restoring instruction, the central processing unit comprising: The instruction execution means includes an update information area for storing register update information for recording whether or not the contents have been updated, and an update recording means for recording updates in the register update information corresponding to the updated register. The saving means includes means for activating the update recording means based on an instruction, and the saving means saves the current register update information to the storage device after the save of the contents of the register is completed, and saves the register update information corresponding to the saved register. The recovery means includes a means for resetting, and the recovery means recovers the contents of a register that has an update record in the corresponding register update information among the registers specified by the register recovery instruction, and updates the register update information corresponding to the recovered register. It is characterized by including means for resetting.

〔作用〕[Effect]

各レジスタに対応してその内容の更新の有無を記録する
レジスタ更新情報を更新情報領域に格納しておく。プロ
グラム呼出時に呼出元によるレジスタの退避のために実
行されるレジスタ退避命令に基づいて起動された退避手
段は、レジスタの内容の退11!終了後に現在のレジス
タ更新情報を外部記憶装置に退避し、退避したレジスタ
に対応するレジスタ更新情報をリセットする。呼出先で
実行されるレジスタ更新命令に基づいて更新が実行され
た後に起動された更新記録手段は、更新されたレジスタ
に対応するレジスタ更新情報に更新を記録する。呼出元
で実行されるレジスタ回復命令に基づいて起動された回
復手段は、指定されたレジスタのうちの対応するレジス
タ更新情報に更新記録のあるレジスタの内容を回復し、
この回復したレジスタに対応するレジスタ更新情報をリ
セットする。以上の動作により不要なレジスタの回復を
回避できる。
Register update information for recording whether or not the contents of each register have been updated is stored in the update information area. The saving means activated based on the register saving instruction executed by the caller to save the register when the program is called saves the contents of the register 11! After completion, the current register update information is saved to an external storage device, and the register update information corresponding to the saved register is reset. The update recording means activated after the update is executed based on the register update instruction executed by the called party records the update in the register update information corresponding to the updated register. The recovery means activated based on the register recovery instruction executed by the caller recovers the contents of the specified register that has an update record in the corresponding register update information,
The register update information corresponding to this recovered register is reset. By the above operation, unnecessary register recovery can be avoided.

〔実施例〕 本発明の実施例について図面を参照して説明する。第1
図は本発明一実施例中央処理装置のブロック構成図であ
り、太い実線矢印は起動関係を示し、また細い実線矢印
は参照設定関係を示す。第1図において、中央処理装置
は、プログラムを格納する複数のレジスタを含むレジス
タ群20と、指定されたレジスタの内容を外部の記憶装
置40に退避する退避手段としてレジスタ退避手段12
と、指定されたレジスタの内容を記憶装置40の該当す
る内容で回復する回復手段としてレジスタ回復手段14
と、レジスタ退避命令に基づいてレジスタ退避手段12
を起動する手段およびレジスタ回復命令に基づいてレジ
スタ回復手段14を起動する手段を含む命令実行手段1
1とを備える。
[Example] An example of the present invention will be described with reference to the drawings. 1st
The figure is a block diagram of a central processing unit according to an embodiment of the present invention, in which thick solid line arrows indicate activation relationships, and thin solid line arrows indicate reference setting relationships. In FIG. 1, the central processing unit includes a register group 20 including a plurality of registers for storing programs, and a register saving means 12 as a saving means for saving the contents of designated registers to an external storage device 40.
and a register recovery means 14 as a recovery means for recovering the contents of the specified register with the corresponding contents of the storage device 40.
and the register saving means 12 based on the register saving instruction.
and means for activating the register recovery means 14 based on the register recovery instruction.
1.

ここで本発明の特徴とするところは、上記各レジスタに
対応してその内容の更新の有無を記録するレジスタ更新
情報を格納する更新情報領域としてレジスタ更新情報領
域30と、更新されたレジスタに対応するレジスタ更新
情報に更新を記録する更新記録手段としてレジスタ更新
記録手段13とを備え、命令実行手段11は、レジスタ
更新命令に基づいてレジスタ更新記録手段13を起動す
る手段を含み、レジスタ退避手段12は、レジスタの内
容の退a終了後に現在のレジスタ更新情報を記憶装置4
0に退避しこの退避したレジスタに対応するレジスタ更
新情報をリセットする手段を含み、レジスタ回復手段1
4は、上記レジスタ回復命令で指定されたレジスタのう
ちの対応するレジスタ更新情報に更新記録のあるレジス
タの内容を回復しこの回復したレジスタに対応するレジ
スタ更新情報をリセットする手段を含むことにある。
Here, the present invention is characterized by a register update information area 30 serving as an update information area for storing register update information that records whether or not the contents have been updated corresponding to each of the above-mentioned registers, and a register update information area 30 corresponding to the updated registers. The instruction execution means 11 includes means for activating the register update recording means 13 based on a register update instruction, and the instruction execution means 11 includes means for activating the register update recording means 13 based on a register update instruction. stores the current register update information in the storage device 4 after the register contents have been saved.
Register recovery means 1 includes means for saving register update information to 0 and resetting register update information corresponding to the saved register.
4 is to include means for restoring the contents of a register having an update record in the corresponding register update information among the registers specified by the register recovery instruction and resetting the register update information corresponding to the recovered register. .

このような構成の中央処理装置の動作を説明する。第2
図は本発明の中央処理装置のレジスタ群とレジスタ更新
情報領域との構成およびその関係を示す図である。第3
図は本発明の中央処理装置の動作を示すフローチャート
である。
The operation of the central processing unit having such a configuration will be explained. Second
The figure is a diagram showing the configuration and relationship between register groups and register update information areas of the central processing unit of the present invention. Third
The figure is a flowchart showing the operation of the central processing unit of the present invention.

第2図において、31..31□、 、31、はレジス
タ211、レジスタ21□、 、レジスタ21.、に対
するレジスタ更新情報である。
In FIG. 2, 31. .. 31□, , 31, is register 211, register 21□, , register 21. This is register update information for .

第1図〜第3図において、中央処理装置10は、命令実
行手段11を起動し、命令実行手段11は、機械命令を
解釈する(Sl)。レジスタ退避命令の実行で、命令実
行手段11は、レジスタ退避手段12を起動しくS2、
S3)、またレジスタの内容を更新する機械命令の実行
に続いて、命令実行手段11は、レジスタ更新記録手段
13を起動しくS2、S6)、さらにレジスタ回復命令
の実行で、命令実行手段11は、レジスタ回復手段14
を起動する(S2、S8)。
1 to 3, the central processing unit 10 activates the instruction execution means 11, and the instruction execution means 11 interprets the machine instruction (Sl). Upon execution of the register save instruction, the instruction execution means 11 activates the register save means 12 in step S2;
S3), and following the execution of the machine instruction to update the contents of the register, the instruction execution means 11 starts the register update recording means 13 (S2, S6), and furthermore, upon execution of the register recovery instruction, the instruction execution means 11 starts the register update recording means 13. , register recovery means 14
(S2, S8).

レジスタ退避手段12は、レジスタ退避命令で指定され
たレジスタとレジスタ更新情報領域30の内容を記憶装
置40に退避しくS4)、指定された各レジスタに対応
するレジスタ更新情報を「0」にリセットする。すなわ
ち、レジスタ21.に対してはレジスタ更新情報31.
が「0」にリセットされる(S5)。
The register saving means 12 saves the registers specified by the register saving instruction and the contents of the register update information area 30 to the storage device 40 (S4), and resets the register update information corresponding to each specified register to "0". . That is, register 21. For register update information 31.
is reset to "0" (S5).

レジスタ更新記録手段13は、更新されたレジスタ21
、に対応するレジスタ更新情報3t+を「1」に設定し
、レジスタ21.が更新されたことを記録する (S7
)。
The register update recording means 13 records the updated register 21.
, and register update information 3t+ corresponding to register 21. , is set to "1". Records that the has been updated (S7
).

レジスタ回復手段14は、レジスタ回復命令で指定され
たレジスタのうちで対応するレジスタ更新情報が更新さ
れたことが記録されているならば(S9)、このレジス
タの内容を記憶装置4oから回復しく5ll) 、そう
でなければ(S9)、このレジスタの内容は変更されて
いないので回復しない(SIO)。すなわち、レジスタ
21.に対してはレジスタ更新情報31tが「1」であ
れば回復を行う。
If it is recorded that the corresponding register update information has been updated among the registers specified by the register recovery instruction (S9), the register recovery means 14 recovers the contents of this register from the storage device 4o. ), otherwise (S9), the contents of this register are not changed and are not recovered (SIO). That is, register 21. If the register update information 31t is "1", recovery is performed.

続いて、記憶装置40に退避されているレジスタ更新情
報領域30の内容と現在のレジスタ更新情報領域30の
内容との論理和を求め、その結果を新しいレジスタ更新
情報領域3Gの内容とする(512)。
Next, the logical sum of the contents of the register update information area 30 saved in the storage device 40 and the contents of the current register update information area 30 is calculated, and the result is set as the contents of the new register update information area 3G (512 ).

上述のようにして本実施例では、呼出元によりレジスタ
退避を実行し、また呼出先でレジスタ更新を実行し、さ
らに呼出元でレジスタ回復を実行することにより、不要
なレジスタの回復を回避し、かつ呼出元で使用していな
いレジスタの退避回復を防止することができる。
As described above, in this embodiment, the caller executes register saving, the callee executes register update, and the caller executes register recovery, thereby avoiding unnecessary register recovery. In addition, it is possible to prevent registers that are not used by the caller from being saved and restored.

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

本発明は、以上説明したように、不要なレジスタの回復
を回避することができる優れた効果がある。
As described above, the present invention has the excellent effect of avoiding unnecessary register recovery.

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

第1図は本発明一実施例中央処理装置のブロック構成図
。 第2図は本発明の中央処理装置のレジスタ群とレジスタ
更新情報領域との構成およびその関係を示す図。 第3図は本発明の中央処理装置の動作を示すフローチャ
ート。 10・・・中央処理装置、11・・・命令実行手段、1
2・・・レジスタ退避手段、13・・・レジスタ更新記
録手段、14・・・レジスタ回復手段、20・・・レジ
スタ群、21.〜21h・・・レジスタ、30・・・レ
ジスタ更新情報領域、31.〜31、・・・レジスタ更
新情報、40・・・記憶装置。
FIG. 1 is a block diagram of a central processing unit according to an embodiment of the present invention. FIG. 2 is a diagram showing the configuration and relationship between register groups and register update information areas of the central processing unit of the present invention. FIG. 3 is a flowchart showing the operation of the central processing unit of the present invention. 10...Central processing unit, 11...Instruction execution means, 1
2... Register saving means, 13... Register update recording means, 14... Register recovery means, 20... Register group, 21. ~21h...Register, 30...Register update information area, 31. ~31... Register update information, 40... Storage device.

Claims (1)

【特許請求の範囲】 1、プログラムを格納する複数のレジスタと、指定され
たレジスタの内容を外部の記憶装置に退避する退避手段
と、指定されたレジスタの内容を上記記憶装置の該当す
る内容で回復する回復手段と、レジスタ退避命令に基づ
いて上記退避手段を起動する手段およびレジスタ回復命
令に基づいて上記回復手段を起動する手段を含む命令実
行手段とを備えた 中央処理装置において、 上記各レジスタに対応してその内容の更新の有無を記録
するレジスタ更新情報を格納する更新情報領域と、更新
されたレジスタに対応するレジスタ更新情報に更新を記
録する更新記録手段とを備え、 上記命令実行手段は、レジスタ更新命令に基づいて上記
更新記録手段を起動する手段を含み、上記退避手段は、
レジスタの内容の退避終了後に現在のレジスタ更新情報
を上記記憶装置に退避しこの退避したレジスタに対応す
るレジスタ更新情報をリセットする手段を含み、 上記回復手段は、上記レジスタ回復命令で指定されたレ
ジスタのうちの対応するレジスタ更新情報に更新記録の
あるレジスタの内容を回復しこの回復したレジスタに対
応するレジスタ更新情報をリセットする手段を含む ことを特徴とする中央処理装置。
[Claims] 1. A plurality of registers for storing programs, a saving means for saving the contents of the specified register to an external storage device, and a saving means for saving the contents of the specified register with the corresponding contents of the storage device. In a central processing unit comprising a recovery means for recovering, and an instruction execution means including means for activating the saving means based on a register saving instruction and means for activating the recovery means based on a register recovery instruction, each of the above registers is provided. an update information area for storing register update information for recording whether or not the contents have been updated in response to the updated register; and update recording means for recording the update in the register update information corresponding to the updated register; includes means for activating the update recording means based on a register update instruction, and the saving means includes:
The recovery means includes means for saving the current register update information to the storage device and resetting the register update information corresponding to the saved register after the save of the contents of the register is completed; A central processing unit comprising means for restoring the contents of a register having an update record in corresponding register update information and resetting the register update information corresponding to the recovered register.
JP13531989A 1989-05-29 1989-05-29 Central processing unit Pending JPH031239A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13531989A JPH031239A (en) 1989-05-29 1989-05-29 Central processing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13531989A JPH031239A (en) 1989-05-29 1989-05-29 Central processing unit

Publications (1)

Publication Number Publication Date
JPH031239A true JPH031239A (en) 1991-01-07

Family

ID=15148970

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13531989A Pending JPH031239A (en) 1989-05-29 1989-05-29 Central processing unit

Country Status (1)

Country Link
JP (1) JPH031239A (en)

Similar Documents

Publication Publication Date Title
JPH031239A (en) Central processing unit
JPH0385650A (en) Disk volume restoration system
JPH0731595B2 (en) Online load module replacement method
JPH0398138A (en) File protection control system
JPH0259837A (en) Data recovery processing system
JPS61121558A (en) Specifying system of number of times of automatic morning call
JPH0443438A (en) Saving system for fault data
JPS6310237A (en) Program control method
JPS61255450A (en) Semiconductor memory device
JPH01202061A (en) Exchange system
JPH03132823A (en) Stacking system for data peculiar to procedure
JPS6254347A (en) Processing system for fault of file
JPH0619711A (en) Stack protection system
JPS63155338A (en) Control system for record of program executing history
JPH02100142A (en) Saving and restoring system for arbitrary register
JPH04264625A (en) Register control system
JPH06266567A (en) Microprocessor
JPS60198661A (en) Input and output control system
JPS62229332A (en) Control system for fault recovery of information processor
JPH02302847A (en) File receding system
JPH04106632A (en) Debug processor
JPS63208128A (en) Register recovery system
JPS62232049A (en) File control table restoring system
JPS6239779B2 (en)
JPH03266145A (en) Fault information gathering system