JPH0359727A - Saving/restoring system in microprocessor - Google Patents

Saving/restoring system in microprocessor

Info

Publication number
JPH0359727A
JPH0359727A JP19433089A JP19433089A JPH0359727A JP H0359727 A JPH0359727 A JP H0359727A JP 19433089 A JP19433089 A JP 19433089A JP 19433089 A JP19433089 A JP 19433089A JP H0359727 A JPH0359727 A JP H0359727A
Authority
JP
Japan
Prior art keywords
stack
internal registers
internal
data
registers
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
JP19433089A
Other languages
Japanese (ja)
Inventor
Yasuo Hirota
廣田 泰生
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 JP19433089A priority Critical patent/JPH0359727A/en
Publication of JPH0359727A publication Critical patent/JPH0359727A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To remove the overhead of a microprocessor by restoring only an internal register in which an updating flag is set up at the time of ending interruption processing. CONSTITUTION:When the execution of an interrupted program is ended,the restoration of internal registers is started. Since the data of respective registers Rdn-1 to Rd3, Rsm to Rs1 are sequentially stored in a stack, the data area read out by push-up based upon an instruction from a stack pointer. When the updating flag of the internal register to be restored is '0' like the Rs3 at the time of referring it, only the value of the stack pointer is updated without reading out data from the stack because rewriting is not executed at the time of executing the interrupted program to access the succeeding data Rs2. Consequently, the overhead of the microprocessor can be removed.

Description

【発明の詳細な説明】 〔概 要〕 状態情報およびデータなどの情報をそれぞれ格納する複
数の内部レジスタを備えるとともに、割込みが発生した
ときにこれら内部レジスタが格納している情報をスタッ
クに退避するようにしたマイクロプロセッサの退避・復
元方式に関し、割込んだプログラムの実行中に実際に使
用されたレジスタおよび状態情報だけを復元するように
してマイクロプロセッサのオーバーヘッドをなくすこと
を目的とし、 内部レジスタのそれぞれに書換えが行われたことを示す
更新フラグを設けるとともにスタックにもこの更新フラ
グをそれぞれの内部レジスタに対応して格納し得るよう
にa威し、割込みが発生したときには状態レジスタと割
込んだプログラムで指定されたデータレジスタとが格納
している情報とこれらに対応する更新フラグとをスタッ
クに退避させた後これらの内部レジスタの更新フラグを
リセットするようにし、割込み処理が終了したときには
更新フラグがセットされている内部レジスタについてだ
け復元を行うように構成した。
[Detailed Description of the Invention] [Summary] The device includes a plurality of internal registers that each store information such as state information and data, and saves the information stored in these internal registers to a stack when an interrupt occurs. Regarding the saving and restoring method for microprocessors, the purpose of this method is to restore only the registers and state information actually used during the execution of the interrupted program, thereby eliminating the overhead of the microprocessor. An update flag is provided for each to indicate that rewriting has been performed, and this update flag is also stored in the stack corresponding to each internal register, and when an interrupt occurs, it is stored in the status register. After saving the information stored in the data register specified by the program and the corresponding update flags to the stack, the update flags of these internal registers are reset, and when the interrupt processing is finished, the update flags are reset. The configuration is configured so that only the internal registers that are set are restored.

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

状態情報およびデータなどの情報をそれぞれ格納する複
数の内部レジスタを備えるとともに、割込みが発生した
ときにこれら内部レジスタが格納している情報をスタッ
クのスタックポインタによって指示されたアドレスに退
避するようにしたマイクロプロセッサに関する。
It has multiple internal registers that each store information such as state information and data, and when an interrupt occurs, the information stored in these internal registers is saved to the address indicated by the stack pointer on the stack. Regarding microprocessors.

〔従来の技術〕[Conventional technology]

プロセッサが処理の実行中に優先度の高い処理からの割
込み、例外処理あるいはサブルーチン・コールなどの割
込みが発生するとこの処理を中断してプロセッサの状態
情報および内部レジスタが格納している命令、データな
ど(本明細書では命令、データなどを単に、データ、と
いう)はスタックなどの退避メモリに退避される。
If an interrupt from a high-priority process, exception handling, or subroutine call occurs while the processor is executing a process, the process is interrupted and the processor state information and instructions and data stored in internal registers are (In this specification, instructions, data, etc. are simply referred to as data) are saved to a save memory such as a stack.

この退避処理を迅速かつ容易に行うために、上記のよう
に内部レジスタに格納されているデータについては、当
該割込み処理を実行する際に使用される内部レジスタが
格納しているデータだけを退避させるようにしている。
In order to perform this saving process quickly and easily, as for the data stored in internal registers as described above, only the data stored in the internal registers used when executing the relevant interrupt process are saved. That's what I do.

そして、この割込み処理が終了すると、退避していたデ
ータがスタックなどの退避メモリからもとの内部レジス
タに復元されるとともに、リターン命令の実行によって
状態情報が復元されて処理が再開される。
When this interrupt processing is completed, the saved data is restored from the saved memory such as the stack to the original internal register, and the status information is restored by executing a return instruction, and the processing is restarted.

第4図はこのような従来の退避・復元方式のフローチャ
ートであって、プログラムAの実行中に割込みが発生す
ると、ステップB1でノ\−ドウエアのプログラムカウ
ンタ、ステータスレジスタあるいは内部フラグなどの状
態情報を退避メモリに退避させる。
FIG. 4 is a flowchart of such a conventional save/restore method. When an interrupt occurs during the execution of program A, state information such as the program counter, status register, or internal flag of the node/ware is saved in step B1. is saved to the save memory.

次のステップB2では割込んだプログラムBで使用する
ために指定されているレジスタの内容を退避メモリに退
避させ、次にステップB3で割込んだプログラムBの処
理を行う。
In the next step B2, the contents of the register designated for use by the interrupted program B are saved to the save memory, and then in step B3, the interrupted program B is processed.

このプログラムBの処理が終了すると、ステップB4で
上記ステップB2で退避したレジスタの内容を元のレジ
スタに復元し、続くステップB5でリターン命令を実行
することによってステップB1で退避した状態情報、を
ステップB6で復元してから、割込みによって中断して
いたプログラムへの処理を再開する。
When the processing of program B is completed, the contents of the registers saved in step B2 are restored to the original registers in step B4, and the status information saved in step B1 is transferred to the step B1 by executing a return instruction in step B5. After restoring at B6, processing of the program interrupted by the interrupt is resumed.

もしステップB3でのプログラムBの実行中に更にプロ
グラムCによる割込みが発生すると、このプログラムB
の処理を中断して上記ステップB1〜B6と同様なステ
ップC1〜C6の処理によってプログラムCを実行し、
その終了後ステ、ツブB3に戻ってプログラムBの処理
を再開する。
If another interrupt by program C occurs during the execution of program B in step B3, this program B
interrupting the processing of and executing the program C by processing steps C1 to C6 similar to steps B1 to B6 above,
After that, the program returns to block B3 and resumes processing of program B.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

しかしながら、割込んだプログラムによって使用が指定
されている内部レジスタは、このプログラムを実行した
際に使用される可能性のあるすべての内部レジスタを含
んでいるものであるから、割込み処理の内容によっては
必ずしもそのすべての内部レジスタが処理に使用される
とは限らず、使用されなかった内部レジスタは割込まれ
る前の内容を保っている。
However, the internal registers specified for use by the interrupting program include all internal registers that may be used when this program is executed, so depending on the contents of the interrupt processing, Not all internal registers are necessarily used for processing, and internal registers that are not used retain their contents before the interrupt.

しかしながら、上記の従来技術においては、このように
割込み前の内容を保っている内部レジスタについても復
元を行うためにマイクロプロセッサのオーバーヘッドを
招くことになる。
However, in the above-mentioned conventional technology, the overhead of the microprocessor is incurred because the internal registers that maintain the contents before the interrupt are also restored.

本発明は割込んだプログラムの実行中に実際に使用され
たレジスタおよび状態情報だけを復元するようにしてマ
イクロプロセッサのオーバーヘッドをなくすことを目的
とする。
An object of the present invention is to eliminate microprocessor overhead by restoring only the registers and state information actually used during execution of the interrupted program.

〔課題を解決するための手段〕[Means to solve the problem]

状態情報およびデータなどの情報をそれぞれ格納する複
数の内部レジスタRS +、 −−−Rs□、Rd+、
  ・・Rd、、を備えるとともに、割込みが発生した
ときにこれら内部レジスタが格納している情報をスタッ
クBのスタックポインタSPによって指示されたアドレ
スに退避するようにしたマイクロプロセッサにおいて、 上記内部レジスタRs、Rdのそれぞれに書換えが行わ
れたことを示す更新フラグfを設けるとともに上記スタ
ックBもこの更新フラグをそれぞれの内部レジスタに対
応して格納し得るように構成し、割込みが発生したとき
には、状態情報を格納している内部レジスタと割込んだ
プログラムで指定割込みが発生したときには、状態情報
とこれらに対応する更新フラグとをスタックに退避させ
た後、これらの内部レジスタの更新フラグをリセットす
るようにし、割込み処理が終了したときにはスタックポ
インタによってスタックのアドレスを順次指示し、更新
フラグがセットされている内部レジスタについてはスタ
ックから読出した情報および更新フラグによってこの内
部レジスタを復元し、更新フラグによつてこの内部レジ
スタについてはスタックからの読出しを行わずにスタッ
クポインタの値のみを更新するようにした。
A plurality of internal registers RS+, ---Rs□, Rd+, each storing information such as status information and data.
In a microprocessor equipped with Rd, , and configured to save the information stored in these internal registers to the address indicated by the stack pointer SP of stack B when an interrupt occurs, the internal register Rs , Rd is provided with an update flag f indicating that rewriting has been performed, and the stack B is configured so that this update flag can be stored correspondingly in each internal register, and when an interrupt occurs, the state is When a specified interrupt occurs in the internal registers that store information and the interrupting program, the status information and the corresponding update flags are saved to the stack, and then the update flags of these internal registers are reset. When the interrupt processing is finished, the stack address is sequentially indicated by the stack pointer, and for internal registers whose update flags are set, the internal registers are restored using the information read from the stack and the update flags, and the update flags are used to restore the internal registers. Therefore, for this internal register, only the value of the stack pointer is updated without reading from the stack.

した。did.

〔作 用〕[For production]

第1図は本発明の原理を示す図であって、マイクロプロ
セッサにはその状態を示す状態情報を格納する状態レジ
スタRS l l  Rs 2r−Rs +aおよび命
令、数値などのデータなどを格納するデータレジスタR
d l 、  Rd 2.   Rdhを含む内部レジ
スタを備えており、これらの内部レジスタRs、Rdに
はそれぞれ書換えが行われたことを示すたの更新フラグ
fが設けられている。
FIG. 1 is a diagram illustrating the principle of the present invention, in which a microprocessor has a status register that stores status information indicating its status, and data that stores data such as instructions and numerical values. Register R
d l, Rd 2. It is provided with an internal register including Rdh, and each of these internal registers Rs and Rd is provided with an update flag f indicating that rewriting has been performed.

プロセッサが処理の実行中にこの処理より優先度の高い
処理からの割込み、例外処理あるいはサブルーチン・コ
ールなどの割込みを受けると、状態情報を格納する内部
レジスタRsl 、RS2゜Rs、およびこの割込んだ
プログラムで指定されたデータを格納する内部レジスタ
例えばRd、。
When the processor receives an interrupt from a process with a higher priority than this process, an exception process, a subroutine call, etc. while executing a process, internal registers Rsl and RS2゜Rs that store state information, and this interrupt An internal register, for example, Rd, that stores data specified by the program.

Rdイ、、、1が格納しているデータはスタックポイン
タSPで指示されたアドレスによって上記更新フラグと
ともにスタックBに退避される。なお、この第1図では
退避すべきレジスタには右上がりのハツチングをして示
しである。
The data stored in Rd I, . In FIG. 1, registers to be saved are indicated by hatching upward to the right.

この退避は例えば内部レジスタRS I 、  Rs 
2゜RS、 、  Rds、−−−Rd+、−1の順序
でスタックにブツシュダウンされるものであり、スタッ
クにはその上方から内部レジスタRa h、、、、、、
、、、、、、 Rd31  R5l11+”””””R
S21  Rs l の順序でそれぞれのデータがスト
ックされる。
This saving can be done, for example, using internal registers RSI, Rs
2゜RS, , Rds, ---Rd+, -1 are pushed down onto the stack in the order of
,,,,,, Rd31 R5l11+”””””R
The respective data are stocked in the order of S21 Rs l .

この退避が終了するとすべての内部レジスタRs、Rd
の更新フラグは例えば“0″にリセットされる。
When this save is completed, all internal registers Rs, Rd
The update flag of is reset to "0", for example.

その後、割込んだプログラムが実行されるが、この処理
の際に書換えが行われた内部レジスタRs、Rdの更新
フラグは例えば1″にセットされ、書換えが行われなか
った内部レジスタのフラグは“0”に維持される。なお
、第1図における各内部レジスタの更新フラグは、この
割込んだプログラムの実行によって、状態情報を格納す
る内部レジスタRS2.R5m−+ およびデータを格
納する内部レジスタRd3が書換えられたものとして示
しである。
After that, the interrupted program is executed, but the update flags of the internal registers Rs and Rd that were rewritten during this process are set to 1'', for example, and the flags of the internal registers that were not rewritten are set to `` The update flags of each internal register in FIG. 1 are maintained at 0'' by the execution of this interrupted program. is shown as having been rewritten.

この割込んだプログラムの実行力4%了すると内部レジ
スタの復元が行われる。すなわち、スタックにはその上
方から内部レジスタRdh−,,Rd31  RS11
”””””RS21  RSl の順序でそれぞれのデ
ータがストックされているのでこれをスタックポインタ
の指示によるブツシュアップによって読出すが、この際
に復元すべき内部レジスタの更新フラグを参照してこの
更新フラグが例えばR83のように0″であれば割込ん
だプログラムの実行の際にも書換えが行われていないの
で復元する必要がなく、したがってスタックからの読出
しは行わずにスタックポインタの値だけを更新して次の
データRS2にアクセスするようにする。
When the execution power of the interrupted program reaches 4%, the internal registers are restored. That is, the stack includes internal registers Rdh-,, Rd31, RS11 from above.
Each data is stored in the order of RS21 RSl, so it is read by pushing up according to the stack pointer.At this time, the update flag of the internal register to be restored is referred to and this data is stored. For example, if the update flag is 0'' like in R83, no rewriting is performed when the interrupted program is executed, so there is no need to restore it, and therefore only the value of the stack pointer is read without reading from the stack. is updated to access the next data RS2.

第1図では割込んだプログラムの実行の際に書換えが行
われて更新フラグが”1”になっているために復元が行
われた内部レジスタに右下がりのハンチングを前記の右
上がりのハツチングに重ねて示してあり、内部レジスタ
RS、、Rs3.R3II + Rd n−1について
はこの右上がりのハツチングのみが施されていることに
よって復元がなされないことが示されている。
In Figure 1, the downward-sloping hunting in the internal register that was restored because it was rewritten when the interrupted program was executed and the update flag was set to "1" is replaced by the above-mentioned upward-rightward hatching. The internal registers RS, , Rs3 . For R3II + Rd n-1, only this upward-sloping hatching is applied, indicating that no restoration is performed.

以上のように本発明では書換えが行われていない内部レ
ジスタへの復元を行わないため、マイクロプロセッサの
オーバーヘッドをなくすことができる。
As described above, in the present invention, since restoration is not performed to internal registers that have not been rewritten, the overhead of the microprocessor can be eliminated.

〔実施例〕〔Example〕

第2図は本発明の実施例を示すものであり、第3図のフ
ローチャートにしたがってこの実施例の動作を説明する
。なお、この第3図のフローチャーFでは説明の便宜上
1つの割込みに対応する場合について示しである。
FIG. 2 shows an embodiment of the present invention, and the operation of this embodiment will be explained according to the flowchart in FIG. Note that, for convenience of explanation, flowchart F in FIG. 3 is shown for a case corresponding to one interrupt.

この実施例のマイクロプロセッサは第2図に示すように
演算・制御回路Cからの状態情報を格納する状態レジス
タSおよび処理に用いる命令や数値などのデータを格納
するデータレジスタRを含む内部レジスタ、これらの内
部レジスタS、Hに格納されている情報を退避するため
の退避スタックBの最も新しい格納アドレスを示すスタ
ックポインタSPとを備えており、上記のように内部レ
ジスタS、 Rに格納されている情報を退避するための
退避スタックBがこのマイクロプロセッサのデータバス
DBに接続されている。なお、上記の内部レジスタS、
RおよびスタックBは演算・制御装置Cによって書込・
続出が行われるものであることはいうまでもない。
As shown in FIG. 2, the microprocessor of this embodiment includes internal registers including a status register S for storing status information from an arithmetic/control circuit C and a data register R for storing data such as instructions and numerical values used for processing; It is equipped with a stack pointer SP indicating the latest storage address of the save stack B for saving the information stored in these internal registers S and H, and as described above, the information stored in the internal registers S and R is A save stack B for saving information stored in the microprocessor is connected to the data bus DB of this microprocessor. Note that the above internal register S,
R and stack B are written/written by arithmetic/control unit C.
Needless to say, this is something that will be published one after another.

なお、説明の便宜上上記スタックのアドレスは最新の格
納アドレス、すなわち第2図ではスタックBの最上位に
あるアドレスを1として下方に1ずつ増加するものとし
て、このアドレスを“B″の添字として用いており、括
弧内に退避した内部レジスタの符号を付記しである。
For convenience of explanation, the address of the stack above is the latest storage address, that is, in FIG. 2, the address at the top of stack B is assumed to be 1 and increases downward by 1, and this address is used as the subscript of "B" The codes of the internal registers saved are added in parentheses.

第3図において、処理要求によってステップ■の処理X
を実行し、ステップ■ではこの処理の終了を識別して終
了でなければステップ■で割込要求があるか否かを判断
し、割込みがなければステ/プ■に戻って処理Xを続け
るが、処理Zの割込要求があるとステップ■から内部レ
ジスタS、  Rの退避動作が開始される。
In FIG. 3, processing X of step
is executed, and in step ■, the end of this process is identified, and if it is not finished, it is determined in step ■ whether or not there is an interrupt request, and if there is no interrupt, the process returns to step ■ and processing X is continued. , When there is an interrupt request for processing Z, the saving operation of internal registers S and R is started from step (3).

この退避動作はステップ■で状態レジスタSのデータを
スタックBをブツシュダウンしながら退避させ、続くス
テップ■で割込んだ処理Zのプログラムで指定されたA
の範囲のデータレジスタR2〜Rfi−1が格納してい
るデータをこれと同様にスタックBに退避させる。した
がって、このスタックBには、第2図に括弧内に示すよ
うに状態情報S1〜S、、が下位のアドレスBsff1
.イ〜Bs0、に、その上方のアドレスBd、、、〜B
1 にデータR5〜Rfi−1がそれぞれフラグfとと
もに格納されることになる。
This saving operation is performed by saving the data in the status register S while shuffling down the stack B in step ■, and in the following step ■, the data in the status register S is saved by
Similarly, the data stored in the data registers R2 to Rfi-1 in the range of is saved to the stack B. Therefore, in this stack B, as shown in parentheses in FIG.
.. A~Bs0, and the upper address Bd,...~B
1, data R5 to Rfi-1 are stored together with the flag f, respectively.

次のステップ■てはこのように退避が完了したすべての
内部レジスタのフラグをリセットして例えば0°′とし
、次のステップ■で割込んだ処理Zの実行を開始する。
In the next step (2), the flags of all the internal registers that have been saved are reset to 0°', for example, and the execution of the interrupted process Z is started in the next step (2).

なお、この処理Zに使用されないデータレジスタ、第2
図図示の例ではRRnについては退避する必要はない。
Note that the second data register, which is not used for this process Z,
In the illustrated example, there is no need to save RRn.

この処理Zを実行している際に内部レジスタに書込みを
行った場合には当該内部レジスタの更新フラグを“1″
にセットするようにし、その実行状態をステップ■で判
断して処理が終了すると次のステップQ以降に移って内
部レジスタの復元を行う。
If an internal register is written while executing this process Z, the update flag of the internal register is set to “1”.
The execution state is determined in step (3), and when the process is completed, the process moves to the next step Q and subsequent steps to restore the internal registers.

ステップ@ではスタックポインタSPの値をスタックB
の最新の格納アドレスである1にセットし、ステップ0
でこの値で指定されるスタックに格納されているデータ
に対応する内部レジスタ、図示の例ではRh−1の更新
フラグを参照し、ステップ○でこの更新フラグが“1″
であるか否かを判断する。
In step @, the value of the stack pointer SP is transferred to the stack B
Set to 1, which is the latest storage address of
Refers to the update flag of the internal register corresponding to the data stored in the stack specified by this value, Rh-1 in the illustrated example, and sets this update flag to "1" in step ○.
Determine whether or not.

第2図図示のようにこの内部レジスタR9−1の更新フ
ラグがパ1”であればステップ○からステップ0に移り
、このステップ■でスタックのBからデータを読出して
このデータで上記内部レジスタRh−1を復元し、その
後にステップ0に移るが、もしこの内部レジスタの更新
フラグが“0”であれば処理Zの実行によってもこの内
部レジスタのデータは書換えられておらず復元を行う必
要がないのでステップ0から直接ステップ0に移ってス
タックポインタの値に1を加算する。
As shown in FIG. 2, if the update flag of this internal register R9-1 is "P1", the process moves from step ○ to step 0, and in step 2, data is read from B on the stack and this data is used to fill the internal register Rh. -1 is restored, and then the process moves to step 0. If the update flag of this internal register is "0", the data in this internal register has not been rewritten by the execution of process Z, and it is necessary to restore it. Since there is no one, we move directly from step 0 to step 0 and add 1 to the value of the stack pointer.

次のステップ0ではこのスタックポインタの値がデータ
の格納領域Bd内にあるか否かを識別するために最初に
退避されたデータが格納されているスタックのアドレス
d□イと比較し、スタックポインタの値pがこのd□8
の値より小さければデータの格納領域であるのでステッ
プ■に戻るが、スタックポインタの値pがd maイよ
り大きければデータレジスタR1〜R,の復元がすべて
終了して状態情報レジスタSの状態格納領域Bsに入る
ことになるので次のステップ[相]に移ってリターン命
令が到来するのを待つ。
In the next step 0, in order to identify whether or not the value of this stack pointer is within the data storage area Bd, it is compared with the stack address d□A where the first saved data is stored, and the value of the stack pointer is The value p is this d□8
If the stack pointer value p is larger than dmai, the restoration of data registers R1 to R is completed and the state is stored in the state information register S. Since it will enter area Bs, it moves to the next step [phase] and waits for the return command to arrive.

このリターン命令が到来するとステップ0でスタックポ
インタの値を状態情報格納領域の最小のアドレスSm1
n とし、以下ステップ0〜■と同様の処理をステップ
■まで行ってスタックのアドレスB5m1h〜Bsma
+<に格納されていた状態情報によって状態情報レジス
タの中で処理Zで書換えられたレジスタを復元し、これ
力増塾了すると割込が行われる前の状態に戻るのでステ
ップのに戻って処理Xの実行を再開する。
When this return instruction arrives, in step 0, the value of the stack pointer is set to the minimum address Sm1 of the state information storage area.
n, and perform the same processing as steps 0 to ■ until step ■ to obtain stack addresses B5m1h to Bsma.
The register that was rewritten in process Z in the status information register is restored using the status information stored in +<, and when this is completed, the status returns to the state before the interrupt was generated, so return to step 1 and process. Resume execution of X.

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

本発明によれば、割込んだ処理の実行中に書換えられな
かった内部レジスタについての復元処理を行う必要がな
いので、この処理に伴うマイクロプロセッサのオーバー
ヘッドをなくすることができるという格別の効果が達成
される。
According to the present invention, there is no need to perform restoration processing for internal registers that were not rewritten during the execution of the interrupted processing, so a special effect is achieved in that the overhead of the microprocessor associated with this processing can be eliminated. achieved.

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

第1図は本発明の原理を示すブロック図、第2図は本発
明の実施例を示すブロック図、第3図は第2図の実施例
の動作を説明するためのフローチャート、 第4図は従来の退避・復元方式のフローチャートである
Fig. 1 is a block diagram showing the principle of the present invention, Fig. 2 is a block diagram showing an embodiment of the invention, Fig. 3 is a flowchart for explaining the operation of the embodiment of Fig. 2, and Fig. 4 is a block diagram showing the embodiment of the invention. 2 is a flowchart of a conventional save/restore method.

Claims (1)

【特許請求の範囲】 状態情報およびデータなどの情報をそれぞれ格納する複
数の内部レジスタ(Rs_l、・・・・・・・・・・R
s_m、Rd_1、・・・・・・・・・・Rd_n)を
備えるとともに、割込みが発生したときにこれら内部レ
ジスタが格納している情報をスタック(B)のスタック
ポインタ(SP)によって指示されたアドレスに退避す
るようにしたマイクロプロセッサにおいて、 上記内部レジスタ(Rs、Rd)のそれぞれに書換えが
行われたことを示す更新フラグ(f)を設けるとともに
上記スタック(B)もこの更新フラグをそれぞれの内部
レジスタに対応して格納し得るように構成し、 割込みが発生したときには、状態情報を格納している内
部レジスタと割込んだプログラムで指定された内部レジ
スタとが格納している情報とこれらに対応する更新フラ
グとをスタックに退避させた後、これらの内部レジスタ
の更新フラグをリセットするようにし、 割込み処理が終了したときにはスタックポインタによっ
てスタックのアドレスを順次指示し、更新フラグがセッ
トされている内部レジスタについてはスタックから読出
した情報および更新フラグによってこの内部レジスタを
復元し、更新フラグがセットされていない内部レジスタ
についてはスタックからの読出しを行わずにスタックポ
インタの値のみを更新するようにしたことを特徴とする
退避・復元方式。
[Claims] A plurality of internal registers (Rs_l, ......R
s_m, Rd_1, ......Rd_n), and when an interrupt occurs, the information stored in these internal registers is indicated by the stack pointer (SP) of the stack (B). In a microprocessor that saves data to an address, an update flag (f) is provided to each of the internal registers (Rs, Rd) to indicate that rewriting has been performed, and the stack (B) also uses this update flag for each of the internal registers (Rs, Rd). It is configured so that it can be stored in correspondence with internal registers, and when an interrupt occurs, the information stored in the internal register storing the state information and the internal register specified by the interrupting program is stored. After saving the corresponding update flags to the stack, the update flags of these internal registers are reset, and when the interrupt processing is finished, the stack address is sequentially indicated by the stack pointer, and the update flags are set. For internal registers, this internal register is restored using the information read from the stack and the update flag, and for internal registers for which the update flag is not set, only the value of the stack pointer is updated without reading from the stack. This is an evacuation/restoration method characterized by:
JP19433089A 1989-07-28 1989-07-28 Saving/restoring system in microprocessor Pending JPH0359727A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19433089A JPH0359727A (en) 1989-07-28 1989-07-28 Saving/restoring system in microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19433089A JPH0359727A (en) 1989-07-28 1989-07-28 Saving/restoring system in microprocessor

Publications (1)

Publication Number Publication Date
JPH0359727A true JPH0359727A (en) 1991-03-14

Family

ID=16322798

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19433089A Pending JPH0359727A (en) 1989-07-28 1989-07-28 Saving/restoring system in microprocessor

Country Status (1)

Country Link
JP (1) JPH0359727A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03242313A (en) * 1990-02-19 1991-10-29 Kawasaki Steel Corp Purification of carbon monoxide

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03242313A (en) * 1990-02-19 1991-10-29 Kawasaki Steel Corp Purification of carbon monoxide

Similar Documents

Publication Publication Date Title
JPH09212371A (en) Register saving and restoring system
JP3970609B2 (en) Processor system
JPS62226234A (en) Stack pointer control circuit
JPH0359727A (en) Saving/restoring system in microprocessor
JPS62151940A (en) Register saving/return system
JPS61184643A (en) Starting control system for virtual computer
JPH01217635A (en) Register saving system
JPS59218569A (en) Microcomputer
JP2573391B2 (en) Programmable controller
JPH03182945A (en) Transfer system for data in main storage
JP2663600B2 (en) Control table relocation processing method
JPH02304624A (en) Information processor
JPS626329A (en) Data transfer circuit
JPH05298119A (en) Context switch mechanism for microprocessor
JPS63314647A (en) Saving/restoring system for task run environment
JPH0262633A (en) Inter-program communication system
JPS6120139A (en) Interruption control system
JPH04127333A (en) Fault detecting system for application task
JPH01175034A (en) Register group loading accelerating system
JPH0333954A (en) Information processor
JPH0486919A (en) Microprogram controller
JPH031252A (en) Page fault processing system
JPS63153650A (en) Memory dump system
JPS617940A (en) Microprogram control device
JPS61127058A (en) Multiplex processor system