JPS62151940A - Register saving/return system - Google Patents

Register saving/return system

Info

Publication number
JPS62151940A
JPS62151940A JP60294243A JP29424385A JPS62151940A JP S62151940 A JPS62151940 A JP S62151940A JP 60294243 A JP60294243 A JP 60294243A JP 29424385 A JP29424385 A JP 29424385A JP S62151940 A JPS62151940 A JP S62151940A
Authority
JP
Japan
Prior art keywords
register
save
registers
saving
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
JP60294243A
Other languages
Japanese (ja)
Inventor
Hisashi Takahashi
久 高橋
Kaoru Hasegawa
薫 長谷川
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 JP60294243A priority Critical patent/JPS62151940A/en
Publication of JPS62151940A publication Critical patent/JPS62151940A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To obtain a register which is efficient in both performance and memory capacity and does not give the burden to the software development by providing a means to hold the type of a register used by an instruction and saving/return the register based upon the information. CONSTITUTION:For the saving of a register, an SFR 309 and an SMR 308 as ANDed through an AND circuit 310, and the information is latched to a register successive selecting circuit 311 by an one-shot generating circuit 313 by having a register storing signal line 312 outputted at the time of executing the register saving instruction. Out of the information latched by the register successive selecting circuit 311, the register information corresponding to the place where one stands is successively outputted to an address bus 304, and actually, out of the information latched by a register successive selecting circuit 311, saving is executed only to the register corresponding to the place where one stands. Consequently, in such a case, the memory saving is executed in which reg1-reg3 only are the stack area and the data area, and reg(n) does not come to be the object. In order to judge at the time of returning a register which register is saved, the present SFR is also simultaneously saved.

Description

【発明の詳細な説明】 (技術分野) 本発明は、複数のレジスタを持つ中央処理装置(CPU
)上で走行するプロダラムにおいて生ずる手続き呼出し
/復帰、あるいはタスク切候時の効率的なレジスタ退避
/復帰方式に関する。
Detailed Description of the Invention (Technical Field) The present invention relates to a central processing unit (CPU) having a plurality of registers.
) This paper relates to procedure calls/returns that occur in a program running on a program or an efficient register save/return method when a task is unavailable.

(従来技術) 手続きの呼出し1手続きからの復帰、あるいはタスクの
切換えの際は、現在の実行環境(コンテキスト)が切換
わるため、主たる実行環境であるレジスタの退避/復帰
が必要である。この処理は一般に手続き呼出し/復帰に
対しては高級言語処理系であるコンパイラが、タスク切
換えに対してはオペレーティングシステム(aS)が行
なう。
(Prior Art) When returning from a procedure call 1 procedure or switching tasks, the current execution environment (context) changes, so it is necessary to save/restore registers, which are the main execution environment. This processing is generally performed by a compiler, which is a high-level language processing system, for procedure calls/returns, and by an operating system (aS) for task switching.

従米手続き呼出し/復帰の際、コンパイラでは、レジス
タ退避/復帰’1cPUの持つ全レジスタに対して行な
うか、もしくは複雑なソフトウェア技術全駆動して手続
き内で使用しているレジスタのみに対して行なっていた
。また、タスク切換えの際、オペレーティングシステム
では、タスクでどのようなレジスタが使用されるか全判
断できないため、レジスタ退避/復帰はレジスタの使用
、不使用にかかわらず全レジスタに対し行なわれていた
O このように従来のレジスタ退避/復帰方式では、不要な
レジスタまで退避/復帰の対象となっておシ、この不要
なレジスタを退避/復帰することにニジ生ずる無駄な時
間的な損失よシ性能的に、また不要なレジスタの退避領
域が生ずる点でメモリ容量的にも問題があった。また、
手続き呼出し/復帰に限って不要なレジスタを退避/復
帰の対象から外す事は可能であるがコンパイラの開発に
かなシの負担がかかるため事実上すべてのレジスタを退
避/復帰する方式が採られていた。
When calling/returning a dependent procedure, the compiler saves/restores registers to all registers owned by the cPU, or only registers used within the procedure by using complex software technology. Ta. Additionally, when switching tasks, the operating system cannot fully determine which registers are used by the task, so register save/restore is performed on all registers regardless of whether they are used or not. In this way, in the conventional register saving/restoring method, unnecessary registers are also subject to saving/returning, and performance is improved by reducing the wasted time caused by saving/restoring these unnecessary registers. Furthermore, there was also a problem in terms of memory capacity in that a save area was created for unnecessary registers. Also,
It is possible to exclude unnecessary registers from being saved/restored only during procedure calls/returns, but this places a burden on compiler development, so in practice a method of saving/restoring all registers is adopted. Ta.

(発明の目的) 本発明の目的は、従来のレジスタ退避/復帰における問
題を除去し、効率的でかつソフトウェア開発にも負担の
かからないレジスタ退避/復帰方式を提供することにあ
る。
(Object of the Invention) An object of the present invention is to provide a register saving/restoring method that is efficient and does not burden software development by eliminating problems in conventional register saving/restoring.

(発明の構成) 本発明によれば、複数のレジスタを持つ中央処理装置に
おいてオ/、オフの値を保持する複数のフラグからなる
記憶(以下セーブフラグレジスタと称す)と、命令の実
行時にセーブフラグレジスタのうち命令で使用されるレ
ジスタに対応するフラグをオンする手段と、セーブフラ
グレジスタを全てオフする手段と、セーブフラグレジス
タ上でオンされたフラグに対応するレジスタの自答ヲメ
モリにストア2よびメモリの内容をレジスタに四−ドす
る手段を備え、レジスタ退避時には、レジスタを使用す
る命令の実行によりオンされているフラグに対応するレ
ジスタ群の内容をメモリにストアし、次に、セーブフラ
グレジスタの内容をメモリにストアし、しかる後セーブ
フラグレジスタを全てオフにし、レジスタ復帰時には、
メモリにストアされているレジスタ退避時のセーブフラ
グレジスタの内容をセーブフラグレジスタにロードし、
そのセーブフラグレジスタを読取シ、オンされているフ
ラグに対応するレジスタ群にメモリの内容をロードする
ことを特徴とするレジスタ退避/復帰方式が得られる。
(Structure of the Invention) According to the present invention, in a central processing unit having a plurality of registers, a memory consisting of a plurality of flags that hold on/off values (hereinafter referred to as a save flag register) and a save flag register when an instruction is executed are provided. A means for turning on a flag corresponding to a register used in an instruction among the flag registers, a means for turning off all save flag registers, and a means for storing in memory the self-response of the register corresponding to the flag turned on in the save flag register. When saving registers, the contents of the register group corresponding to the flags turned on by executing an instruction that uses the registers are stored in memory, and then the save flags are saved. Stores the register contents in memory, then turns off all save flag registers, and when the registers are restored,
Loads the contents of the save flag register when saving registers stored in memory into the save flag register,
A register save/restore method is obtained which is characterized in that the save flag register is read and the contents of the memory are loaded into the register group corresponding to the flag that is turned on.

また、さらに退避/復帰するレジスタ群をあらかじめ指
定する情報を保持する手段(以下セーブマスクレジスタ
と称す)を備えることにより、セ一ブフラグレジスタと
セーブマスクレジスタを組合わせた情報に基き、レジス
タのメモリへのストア2よびメモリよりのレジスタへの
ロードラ行すうこと全特徴とするレジスタ退避/復帰方
式が得られる。
Furthermore, by providing means for holding information that specifies in advance the register group to be saved/restored (hereinafter referred to as a save mask register), registers can be A register save/restore method is obtained which is characterized by a store to memory 2 and a loader from memory to register.

(作用、効果) 本発明では、セーブフラグレジスタ(以下8FRと略す
。)は、命令実行ごとに更新され、使用されたレジスタ
に対応するフラグがオンされていく。
(Operations and Effects) In the present invention, the save flag register (hereinafter abbreviated as 8FR) is updated every time an instruction is executed, and the flag corresponding to the used register is turned on.

したがって、8FR7a−参照することにより、現在ま
での命令実行で使用されたレジスタの種類を判別するこ
とができる。このためコンパイラでは、手続き呼出し/
復帰時に複雑なソフトウェア技術を用いずとも退避/復
帰すべきレジスタを指定することが1.まfCOSにお
いては、実行中のタスクの5PR−i参照すれば容易に
コンテキスト切換え時に処理すべきレジスタを知ること
ができる。
Therefore, by referring to 8FR7a, it is possible to determine the type of register used in the instruction execution up to now. For this reason, the compiler uses procedure calls/
1. It is possible to specify the registers to be saved/restored without using complicated software technology at the time of restoration. In fCOS, by referring to 5PR-i of the task being executed, it is possible to easily know the register to be processed at the time of context switching.

このように1本発明よシ、単にSFRを基にしたレジス
タ退避/復帰を行なうだけで、必要最小限のレジスタの
みを退避/復帰することができ、簡単でかつ効果的なレ
ジスタ退避/復帰処理が実現できる。
In this way, according to the present invention, only the minimum necessary registers can be saved/restored by simply performing register saving/restoring based on the SFR, which is a simple and effective register saving/restoring process. can be realized.

またさらに、退避/復帰するレジスタ群をあらかじめ指
定するレジスタ(セーブマスクレジスタ・・・・・・以
下 SMRと略す)を設けることにより、有効なレジス
タ退避/復帰処理ができる。これは、レジスタ退避/復
帰の際8F’RとSMRを組合わせて、例えば論理積を
取ることにより、レジスタ退避/復帰情報を作9出し、
これを基にレジスタ退避/復帰処理を行なうものである
。このSMRによるレジスタ退避/復帰の対象レジスタ
の限定は、コンパイラにおいてグローバルな変数(複数
の手続きに共通な変数)領域としてレジスタを用いる場
合や、タスク間の共通変数領域としてレジスタを用いる
場合に有効である。
Furthermore, by providing a register (save mask register...hereinafter abbreviated as SMR) that specifies in advance a group of registers to be saved/restored, effective register saving/restoring processing can be performed. This creates register save/restore information by combining 8F'R and SMR during register save/restore, for example by taking a logical product.
Based on this, register save/restore processing is performed. This limitation of registers subject to register save/restore using SMR is effective when registers are used as global variable areas (variables common to multiple procedures) in the compiler, or when registers are used as common variable areas between tasks. be.

(実施例) 次に本発明の一実施例について図面全参照して説明する
(Example) Next, an example of the present invention will be described with reference to all the drawings.

本発明の実施例を第1図〜第6図に示す。第1図は、実
施例の概略を示すものである。1は中央処理装置、2は
記憶装置、3はレジスタ群、4はセーブフラグレジスタ
(以下SFRと称す)、5はセーブマスクレジスタ(以
下SMB、と称す)を示す。ここでレジスタはn本(n
>1)6るとし、SFB、SMRはn個の7ラグっまJ
onビットで構成されている。また8FHの各々のフラ
グは。
Examples of the present invention are shown in FIGS. 1 to 6. FIG. 1 shows an outline of an embodiment. 1 is a central processing unit, 2 is a storage device, 3 is a register group, 4 is a save flag register (hereinafter referred to as SFR), and 5 is a save mask register (hereinafter referred to as SMB). Here, there are n registers (n
>1) 6, SFB, SMR are n 7 lags J
It consists of an on bit. Also, each flag of 8FH.

1の時、そのフラグに対応するレジスタは今までの命令
群中で使用されていることを示しておシ。
When it is 1, it indicates that the register corresponding to that flag has been used in the previous instruction group.

0の時は、使用されていないこと?示す。SMR。Does it mean that it is not used when it is 0? show. S.M.R.

の各々のフラグは、1の時、そのフラグに対応するレジ
スタは、レジスタ退避/復帰の対象レジスタであること
を示し、0の時は対象外であることを示す。
When each flag is 1, it indicates that the register corresponding to the flag is a target register for register save/restore, and when it is 0, it indicates that it is not a target register.

ここで、レジスタ群3のうち、レジスタ番号m(0≦m
≦n)(以下regmと称し、また一般にregiは、
レジスタ番号it−意味する。)からre−gnまでを
手続群で共通な変数の領域(グローバル変数領域)又は
、タスク間で共通な領域とする。
Here, among register group 3, register number m (0≦m
≦n) (hereinafter referred to as regm, and generally regi is
Register number it-means. ) to re-gn is defined as a variable area common to a procedure group (global variable area) or a common area between tasks.

したがってこの場合r e gn’xr e g n 
 は手続きの呼出し/復帰、タスクの切換えがあっても
レジスタ退避/復帰する必要がなく、レジスタ退避/復
帰対象外レジスタとなる。第2図は、上述の状態を表わ
すSMRの詳細rs、b、regl〜reg(m−1)
 iEレジスタ退避/復帰対象レジスタであることを示
し、 regm”−regnまでがレジスタ退避/復帰
対象外レジスタであることを示している。
Therefore, in this case r e gn'xr e g n
There is no need to save/restore registers even if a procedure is called/restored or a task is switched, and these registers are not subject to register saving/restoration. FIG. 2 shows the details of the SMR representing the above-mentioned state rs, b, regl~reg(m-1)
This indicates that the iE register is a register to be saved/restored, and indicates that the registers up to regm''-regn are registers not to be saved/restored.

第3図は、本実施例の構成を示す図である。301は中
央処理装置、、302は記憶装置、303はデータバス
、304はレジスタを選択するアドレスバス、 305
は外部バス、306はレジスタ群、307は命令デコー
ダ、308はSMR,309はSFR,,310はアン
ド回路、311はSMR。
FIG. 3 is a diagram showing the configuration of this embodiment. 301 is a central processing unit, 302 is a storage device, 303 is a data bus, 304 is an address bus for selecting a register, 305
306 is an external bus, 306 is a register group, 307 is an instruction decoder, 308 is an SMR, 309 is an SFR, 310 is an AND circuit, and 311 is an SMR.

とSFR,のアンドを取ったレジスタ退避/復帰情報か
らオンになっているフラグに対応するレジスタを順次選
択するレジスタ順次選択回路、312は、レジスタ退避
/復帰命令の実行時に出力されるレジスタストア/ロー
ド信号線、313は、アンド回路310から出力された
レジスタ退避/復帰情報をレジスタ退避/復帰命令実行
時にレジスタ順次選択回路にラッチさせるための1ショ
ット生成回路、314は8FRのクリア信号、315は
、中央処理装置と記憶装置間のデータのやシとbt行な
うリード/ライト回路を示す。
A register sequential selection circuit 312 sequentially selects registers corresponding to flags that are turned on from the register save/restore information obtained by ANDing the register save/restore information and SFR. A load signal line 313 is a one-shot generation circuit for latching the register save/restore information output from the AND circuit 310 into a register sequential selection circuit when executing a register save/restore command, 314 is an 8FR clear signal, and 315 is a , shows a read/write circuit that performs data transfer between the central processing unit and the storage device.

第4図は、本実施例において実行されるプログラムであ
る。401はプログラム、402はこの手続き名がAB
Cであることを示し、403は。
FIG. 4 shows a program executed in this embodiment. 401 is the program, 402 is the procedure name AB
403 indicates that it is C.

reglに値1を代入することを示しておシ%404は
、他の手続き1r、呼出していることを示している。
%404, which indicates that the value 1 is assigned to regl, indicates that another procedure 1r is being called.

また、第5図は、第4図のプログラムを実行した際の8
FRの状態、第6図は1手続き呼出し/復帰時のレジス
タ退避/復帰状態を示している。
In addition, Figure 5 shows the 8 times when the program in Figure 4 is executed.
FIG. 6 shows the register save/restore state at the time of one procedure call/return.

次に第2図〜第6図を参照して本実施例におけるレジス
タ退避/復帰方式の動作を説明する。
Next, the operation of the register save/restore method in this embodiment will be explained with reference to FIGS. 2 to 6.

命令の実行にあたシ、命令でレジスタが使用された場合
、第3図の命令デコーダ307よシレジスタ選択情゛報
がアドレスバス304にのり、8FR309に入力され
、8FRのうち使用されたレジスタに対応するフラグが
1に設定される。また、手続きの実行が開始される前に
8FRクリア信号314よ、9.8FRの各フラグは全
て0にクリアされる。
When a register is used in an instruction when executing an instruction, register selection information from the instruction decoder 307 in FIG. The corresponding flag is set to 1. In addition, before the execution of the procedure is started, the 8FR clear signal 314 and each flag of 9.8FR are all cleared to 0.

lす第4図のプログラム401のうち、命令403が実
行されると、この命令では、reglが使用されている
ため、SFBの1ビツト目が1となる。
When the instruction 403 in the program 401 in FIG. 4 is executed, the first bit of SFB becomes 1 because regl is used in this instruction.

第5図(alにこの時の8FB、を示す。次に命令40
4の直前まで実行されると、レジスタはregl、re
g2+reg3.regnが使用され、第5図(b)に
示すようにSFRの1.2,3.nビット目が1となる
FIG. 5 (al shows 8FB at this time. Next, instruction 40
4, registers regl, re
g2+reg3. regn is used, and as shown in FIG. 5(b), the SFR is 1.2, 3. The nth bit becomes 1.

次に命令404が実行され1手続き呼出しが行なわれる
が、この時に呼出し側の手続きのコンテキスト退避のた
めにレジスタの退避が必要である。
Next, the instruction 404 is executed and one procedure is called, but at this time it is necessary to save the register in order to save the context of the calling procedure.

レジスタの退避の処理は、通常、呼出された手続きの最
初か、または、手続き呼出し命令の直前で行なわれる。
Register saving processing is normally performed at the beginning of a called procedure or immediately before a procedure call instruction.

本実施例におけるレジスタ退避は。Register saving in this embodiment is as follows.

SFRと8 MRffi基に行なわねる。このレジスタ
退避は、第3図において、5FR309と5MR308
をアンド回路310全通し、論理積を取り、その情報を
レジスタ退避命令実行時に出力されるレジスタストア信
号線312を持って1ショット生成回[313よシ、レ
ジスタ順次選択回路311にラッチし、レジスタ順次選
択回路でラッチした情報のうち、1が立っている所に対
応するレジスタ情報をアドレスバス304に順次出力し
、実際には、レジスタ順次選択回路でラッチした情報の
うち、1が立っている所に対応するレジスタのみに対し
て行なう。したがってこの場合は、regl。
SFR and 8 MRffi groups. This register saving is performed by 5FR309 and 5MR308 in FIG.
is passed through the AND circuit 310, the logical product is taken, and the information is transferred to the register store signal line 312 that is output when the register save instruction is executed. Out of the information latched by the sequential selection circuit, register information corresponding to where 1 is set is sequentially output to the address bus 304, and in reality, among the information latched by the register sequential selection circuit, 1 is set. This is done only for the register corresponding to the location. Therefore, in this case, regl.

reg2. reg3のみがスタック領域、データ領域
であるメモリ退避され、regnはその対象とならない
。また、どのようなレジスタが退避されているかをレジ
スタ復帰時に判断するために、現在のSFBも同時に退
避する。第6図(alは、この状態を示しており、この
図に2いて601はレジスタ群、602は8FR,60
3はSMR,604はメモリに退避されたレジスタ群を
示す。
reg2. Only reg3 is saved in memory, which is a stack area and a data area, and reg3 is not saved. Furthermore, in order to determine what kind of register has been saved at the time of register restoration, the current SFB is also saved at the same time. FIG. 6 (al indicates this state; in this figure, 2, 601 is a register group, 602 is 8FR, 60
3 indicates an SMR, and 604 indicates a register group saved in memory.

レジスタ退避後、前述したように新しい手続きを実行す
るにあたJ、8F凡の各々のフラグは全てOにクリアさ
れる。
After the register is saved, the flags J and 8F are all cleared to O when a new procedure is executed as described above.

手続き終了時においては1手続き復帰命令の直帰または
、手続き復帰直後にレジスタ復帰が行なわれる。本実施
例におけるレジスタ復帰は、まず。
At the end of a procedure, a direct return of one procedure return instruction or a register return is performed immediately after the procedure return. In this embodiment, register restoration is performed first.

レジスタ退避で退避されたSFR,6メモリから8PR
SFR saved by register save, 8PR from 6 memory
.

に胃−ドし、その後は、レジスタ退避と同様にレジスタ
復帰も、SFBとSMHの論理積を取シ、1が立ってい
る所と対応するレジスタのみ行なわれ、regl 、 
reg2. reg3のみが、メモリからロードされる
。第6図(b)はこの状態を示している。
After that, in the same way as register saving, register restoration is performed by taking the AND of SFB and SMH, and only registers corresponding to where 1 is set are performed, and regl,
reg2. Only reg3 is loaded from memory. FIG. 6(b) shows this state.

以上手続きの呼出し/復帰に対して説明したが。I have explained above about procedure calls/returns.

タスク切換え時も全く同様に行なうことができる。Exactly the same thing can be done when switching tasks.

本実施例では、退M/復帰するレジスタ群全指定するレ
ジスタ(セーブマスクレジスタ)ヲ有しているが、この
レジスタがなくても光分に効率的欧しジスタ退避/俊帰
が行なえる。
Although this embodiment has a register (save mask register) that specifies all the register groups to be saved/restored, efficient register saving/return can be performed even without this register.

また本実施例において、レジスタ退避および復帰の一連
の処理を一命令として実現してもよく、こうすることに
より、レジスタ退避/復帰のソフトウェア処理ヲ簡単化
することができる。
Furthermore, in this embodiment, a series of register saving and restoring processes may be implemented as one instruction, thereby simplifying the register saving/restoring software processing.

(発明のまとめ) 本発明は、以上説明したように、命令で使用されたレジ
スタの種類を保持する手段を設け、その情報を基に、レ
ジスタの退避/復帰を行なうことにより、手続き呼出し
/復帰時、タスク切換時に必要最小限のレジスタに対し
て退避/復帰処理が行なわれ、性能、メモリ容量とも効
率的で、かつソフトウェア開発にも負担のかからないレ
ジスタ退避/復帰処理が実現できる。
(Summary of the Invention) As explained above, the present invention provides a means for retaining the type of register used in an instruction, and saves/restores registers based on that information, thereby making procedure calls/returns possible. At the same time, the save/restore process is performed on the minimum necessary registers when switching tasks, making it possible to realize register save/restore processes that are efficient in terms of performance and memory capacity, and do not place a burden on software development.

さらに退避/復帰すべきレジスタ群をあらがじめ指定す
る手段を設けることによυ、コンパイラに2いてグロー
バルな変数領域としてレジスタを用いる場合や、タスク
間の共通変数領域としてレジスタを用いる場合に、非常
に有効である。
Furthermore, by providing a means to specify in advance a group of registers to be saved/restored, it is possible to use registers in the compiler as a global variable area, or as a common variable area between tasks. , very effective.

【図面の簡単な説明】 第1図は、本実施例の概略図、第2図は本実施例におけ
るセーブマスクレジスタ(SMH)の状態図、第3図は
、本実施例の構成、第4図は本実施例におけるプログラ
ム図、第5図(al 、 (blは、第4図プログラム
を実行した際のセーブフラグレジスタ(SFl’L)の
状態図、第6図(al 、 (blU、本実施例におけ
るレジスタ退避/復帰の状態を示す図である。 l・・・・・・中央処理装置、2・・・・・・記憶装置
、3・・・・・・レジスタ群、4・・・・・・SFR,
5・・・・・・SMR,301・・・・・・中央処理装
置%302・・・・・記憶装置、303・・・・・・デ
ータバス、304・・・・・・レジスタを選択するアド
レス、305・・・・・・外部バス、306・・・・・
・レジスタ群、307・・・・・・命令テコーダ、30
8・・・・・・滉、309・・・・・・SFR,310
・・・・・・771回路、311・・・・・・レジスタ
順次選択回路%312・・・・・・レジスタストア/ロ
ード信号線、313・・・・・・1ショット生成回路、
314・・・・・・SFRのクリア信号、315・・・
・・・リード/ライト回路、401・・・・・・本実施
例におけるプログラム、402,403,404・・・
・・・プログラム要素、601・・・・・・レジスタ群
、602・・・・・・8FR,603・・・・・・SM
R,604・・・・・・メモリ〇
[BRIEF DESCRIPTION OF THE DRAWINGS] FIG. 1 is a schematic diagram of this embodiment, FIG. 2 is a state diagram of the save mask register (SMH) in this embodiment, and FIG. 3 is a diagram showing the configuration of this embodiment. The figures are the program diagram in this embodiment, Figure 5 (al, (bl) is the state diagram of the save flag register (SFL'L) when the program in Figure 4 is executed, and Figure 6 (al, (blU, book). It is a diagram showing the state of register save/restore in the embodiment. l...Central processing unit, 2...Storage device, 3...Register group, 4... ...SFR,
5...SMR, 301...Central processing unit%302...Storage device, 303...Data bus, 304...Select register Address, 305... External bus, 306...
・Register group, 307...Instruction encoder, 30
8......SFR, 309...SFR, 310
771 circuit, 311... Register sequential selection circuit %312... Register store/load signal line, 313... 1 shot generation circuit,
314...SFR clear signal, 315...
...Read/write circuit, 401...Program in this embodiment, 402, 403, 404...
...Program element, 601...Register group, 602...8FR, 603...SM
R, 604...Memory〇

Claims (2)

【特許請求の範囲】[Claims] (1)複数のレジスタを持つ中央処理装置において、オ
ン、オフの値を保持する複数のフラグからなる記憶手段
(以下セーブフラグレジスタと称す)と、命令の実行時
にセーブフラグレジスタのうち命令で使用されるレジス
タに対応するフラグをオンする手段と、セーブフラグレ
ジスタを全てオフする手段と、セーブフラグレジスタ上
でオンされたフラグに対応するレジスタの内容をメモリ
にストアおよびメモリの内容をレジスタにロードする手
段を備え、レジスタ退避時には、レジスタを使用する命
令の実行により、オンされているフラグに対応するレジ
スタ群の内容をメモリにストアし、次に、セーブフラグ
レジスタの内容をメモリにストアし、しかる後、セーブ
フラグレジスタを全てオフにし、レジスタ復帰時には、
メモリにストアされているレジスタ退避時のセーブフラ
グレジスタの内容をセーブフラグレジスタにロードし、
そのセーブフラグレジスタを読取り、オンされているフ
ラグに対応するレジスタ群にメモリの内容をロードする
ことを特徴とするレジスタ退避/復帰方式。
(1) In a central processing unit that has multiple registers, there is a storage means (hereinafter referred to as a save flag register) consisting of multiple flags that hold on and off values, and a save flag register that is used by an instruction when an instruction is executed. means to turn on the flag corresponding to the register to be turned on, means to turn off all save flag registers, store the contents of the register corresponding to the flag turned on in the save flag register to memory, and load the contents of memory to the register. When saving registers, the contents of the register group corresponding to the flags that are turned on are stored in the memory by executing an instruction that uses the registers, and then the contents of the save flag register are stored in the memory, After that, all save flag registers are turned off, and when the registers are restored,
Loads the contents of the save flag register when saving registers stored in memory into the save flag register,
A register save/restore method characterized by reading the save flag register and loading the contents of memory into a group of registers corresponding to flags that are turned on.
(2)特許請求範囲(1)のレジスタ退避/復帰方式で
あって、退避/復帰すべきレジスタ群をあらかじめ指定
する情報を保持する手段(以下セーブマスクレジスタと
称す)を有し、セーブフラグレジスタとセーブマスクレ
ジスタを組合わせた情報に基き、レジスタのメモリへの
ストアおよびメモリよりのレジスタへのロードを行なう
ことを特徴とするレジスタ退避/復帰方式。
(2) The register save/restore method as claimed in claim (1), which includes means (hereinafter referred to as a save mask register) for holding information that specifies in advance a group of registers to be saved/restored, and a save flag register. A register save/restore method characterized by storing registers to memory and loading registers from memory based on information obtained by combining the register and save mask register.
JP60294243A 1985-12-25 1985-12-25 Register saving/return system Pending JPS62151940A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60294243A JPS62151940A (en) 1985-12-25 1985-12-25 Register saving/return system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60294243A JPS62151940A (en) 1985-12-25 1985-12-25 Register saving/return system

Publications (1)

Publication Number Publication Date
JPS62151940A true JPS62151940A (en) 1987-07-06

Family

ID=17805201

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60294243A Pending JPS62151940A (en) 1985-12-25 1985-12-25 Register saving/return system

Country Status (1)

Country Link
JP (1) JPS62151940A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01312634A (en) * 1988-06-10 1989-12-18 Matsushita Electric Ind Co Ltd Data processor
JPH03188531A (en) * 1989-12-18 1991-08-16 Matsushita Electric Ind Co Ltd Time-division multitask executing device
JPH064305A (en) * 1992-06-22 1994-01-14 Nec Corp Register switching discrimination circuit for processor
JP2011150636A (en) * 2010-01-25 2011-08-04 Renesas Electronics Corp Microprocessor and control method thereof
JP2019022549A (en) * 2017-07-23 2019-02-14 株式会社三洋物産 Game machine
JP2019022554A (en) * 2017-07-23 2019-02-14 株式会社三洋物産 Game machine
JP2019022548A (en) * 2017-07-23 2019-02-14 株式会社三洋物産 Game machine

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01312634A (en) * 1988-06-10 1989-12-18 Matsushita Electric Ind Co Ltd Data processor
JPH03188531A (en) * 1989-12-18 1991-08-16 Matsushita Electric Ind Co Ltd Time-division multitask executing device
JPH064305A (en) * 1992-06-22 1994-01-14 Nec Corp Register switching discrimination circuit for processor
JP2011150636A (en) * 2010-01-25 2011-08-04 Renesas Electronics Corp Microprocessor and control method thereof
JP2019022549A (en) * 2017-07-23 2019-02-14 株式会社三洋物産 Game machine
JP2019022554A (en) * 2017-07-23 2019-02-14 株式会社三洋物産 Game machine
JP2019022548A (en) * 2017-07-23 2019-02-14 株式会社三洋物産 Game machine

Similar Documents

Publication Publication Date Title
US4771380A (en) Virtual vector registers for vector processing system
JPS6027964A (en) Memory access control circuit
US7080239B2 (en) Loop control circuit and loop control method
JP3970609B2 (en) Processor system
JPS62151940A (en) Register saving/return system
US6199143B1 (en) Computing system with fast data transfer of CPU state related information
KR100654477B1 (en) Object oriented processing with dedicated pointer memories
CN1468397A (en) register move operation
EP0915416A2 (en) System for allowing a two word instruction to be executed in a single cycle and method therefor
JP3278624B2 (en) Vector processing apparatus and maximum vector length control method
JP2506591B2 (en) Auxiliary processor
JP2583614B2 (en) Vector arithmetic unit
JPS63261430A (en) Method and apparatus for information processing
JP3068406B2 (en) Vector arithmetic unit
JPH08286950A (en) Information processor and trace information storage method
JPH0262633A (en) Inter-program communication system
JPH0511328B2 (en)
JPH02232727A (en) Information processor
JPH04293159A (en) Vector data processor
JPH03158943A (en) Buffer storage/transfer system
JPH04217027A (en) Information processor
JPH01175034A (en) Register group loading accelerating system
JPS626329A (en) Data transfer circuit
JPH04245333A (en) Information processor
JPH02247758A (en) Control system for terminal information