JPH0241771B2 - - Google Patents

Info

Publication number
JPH0241771B2
JPH0241771B2 JP9676087A JP9676087A JPH0241771B2 JP H0241771 B2 JPH0241771 B2 JP H0241771B2 JP 9676087 A JP9676087 A JP 9676087A JP 9676087 A JP9676087 A JP 9676087A JP H0241771 B2 JPH0241771 B2 JP H0241771B2
Authority
JP
Japan
Prior art keywords
memory
interrupt
return address
processing
signal
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.)
Expired
Application number
JP9676087A
Other languages
Japanese (ja)
Other versions
JPS63233438A (en
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 filed Critical
Publication of JPS63233438A publication Critical patent/JPS63233438A/en
Publication of JPH0241771B2 publication Critical patent/JPH0241771B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked

Description

【発明の詳細な説明】[Detailed description of the invention]

[産業上の利用分野] 本発明は、既存のマイクロプロセツサとオブジ
エクト・コードの互換性があり、割り込み処理の
リターンアドレスの発生方法に違いのあるマイク
ロプロセツサを使用したシステムにおいて、その
非互換性を解消するための情報処理装置に関す
る。 [従来の技術] 従来、既存のマイクロプロセツサとオブジエク
ト・コードでの互換性のあるマイクロプロセツサ
において、同じ割り込み処理におけるリターンア
ドレスの発生方法が異なつているものがあつた。 [発明が解決しようとする問題点] しかし、割り込み処理のリターンアドレスの発
生方法の違いにより、それぞれのマイクロプロセ
ツサにおいて、同じソフトウエアで異なつた動作
を起こすという問題点を有していた。 そこで、本発明は従来のこのような問題点を解
決するために、リターンアドレスの発生方法の違
う割り込みが発生しても、各々のマイクロプロセ
ツサで同じ動作をさせることを目的とする。 [問題点を解決するための手段] 本発明は、 所定の割り込み処理を検知する検知手段と、該
検知手段よりの結果に応じて、メモリの第1所定
エリアに格納する前記割り込み処理からのリター
ンアドレスの修正処理を起動するためのリターン
アドレス修正処理起動情報により起動され前記リ
ターンアドレス修正処理を実行するリターンアド
レス修正手段と、 アクセスするメモリを前記第1所定エリアか
ら、前記割り込み処理を起動するための割り込み
処理起動情報を格納する第2所定エリアに切り替
えるメモリ切り替え手段とを有し、 所定の割り込み処理を検知した場合に該割り込
み処理からのリターンアドレスを修正する処理と
前記所定の割り込み処理を実行することを 特徴とする。 [作用] 上記のように構成された装置を、コンピユータ
に付加することにより、上記別メモリに、リター
ンアドレス修正ルーチンの先頭アドレスを書き込
んでおけば、目的の割り込み発生時にはマイクロ
プロセツサが参照する値を、処理ルーチンの先頭
にすることができる。処理ルーチン内でリターン
アドレスを既存のマイクロプロセツサにおける同
じ割り込みで発生するリターンアドレスに等しく
なるように修正する。そして、別メモリをリード
することにより、本来の割り込み処理ルーチンの
先頭アドレスを得ることができるので、そこに制
御を移すことにより、既存のマイクロプロセツサ
を用いたシステムと同様な動作を得ることができ
る。 [実施例] まず、本発明の原理を第1,2図を使つて説明
する。 まず第1図について説明する。本発明では、エ
リア10にある値(例えば01H)を書いた場合
(データフロー113)、該01Hを読み出すために
CPUはエリア11をアクセスする。(データフロ
ー114)そして該エリア11へのリードアクセ
スが変換されて、実際にはエリア10をアクセス
することになる。 又、エリア11にある値(例えば02H)を書い
た場合(データフロー116)、該02Hを読み出
すためにCPUは、エリア10をアクセスする。
(データフロー115)そして、前記と同様にエ
リア10へのアクセスが、実際には、エリア11
へのアクセスに変換され02Hが読み出される。 ここで、まず所定の割り込み処理が、検知され
る前に、CPUは、エリア10に所定の割り込み
処理を起動させるための情報(例えば、該割り込
み処理を実行するプログラムの先頭アドレス)を
ライトし、エリア11に該割り込み処理からのリ
ターンアドレスの修正処理を起動するための情報
(例えば、リターンアドレスの修正処理のプログ
ラムの先頭アドレス)をライトしておく。 したがつて、所定の割り込み処理が検知されて
CPUがエリア10へリードアクセスすると、実
際には、エリア11内にあるリターンアドレスの
修正処理を起動する情報が読み出され、割り込み
処理の前にまずリターンアドレスの修正が実行さ
れるのである。 又、第2図は、第1図と異なりライト動作につ
いてエリア10,11を入れ換えた場合を示す。 すなわち、第2図のケースではリードの場合
は、CPUで指定したエリアよりデータを(デー
タフロー224,225)を読み出せる。しか
し、ライトの場合は、CPUでエリア10を指定
すると実際にはエリア11に書かれ、(データフ
ロー223)エリア11を指定すると実際にはエ
リア10に書き込まれる。(データフロー226)
第2図の場合では、所定の割り込み処理が発生す
る前に、CPUがエリア10に対してライトアク
セスを行い、実際には、エリア11に割り込み処
理を起動させるための情報を書いておき、又、
CPUがエリア11に対してライトアクセスを行
つて、実際には、エリア10にリターンアドレス
の修正処理を起動するための情報を書いておく。
そうすると、所定の割り込み処理が検知されると
エリア10がアクセスされ第1図と同様にまず、
リターンアドレスの修正処理が、実行される。 以下に本発明の実施例を示す。第3図は、本発
明を実現するためのメモリ制御回路の実施例であ
る。第3図において、1は、特別割り込みベクタ
用アドレステコード回路であり、特別割り込みベ
クタのアドレスが選択された時に、信号35に0
を出力し、それ以外のアドレスが選択された時、
1を出力する。2は、メモリセレクト回路であ
り、ソフトウエアからのセレクト信号(図示せ
ず)により、BANK信号30を決定する。特別
割り込みベクタとは、既存のマイクロプロセツサ
と、割り込み処理からのリターンアドレスの発生
方法の違う割り込みの割り込みベクタである。 第4図に、メモリマツプを示す。この図で、メ
モリ20は、特別割り込みベクタ、メモリ21は
メモリ20に対応した動作上問題のない別のメモ
リである。また、MRNは、メモリ・リード信
号、MWNは、メモリ・ライト信号、0は、
メインメモリ25に対するメモリ・リード信号、
MR1は、メモリ21に対するメモリ・リード信
号、は、メインメモリ25に対するメモリ
−ライト信号、1はメモリ21に対するメモ
リ・ライト信号である。 この回路は、BANK信号30が0のとき信号
31は1、信号36は信号35と等しくなり、信
号35が0のとき、ゲート42とゲート43が開
き、信号35が1のとき、ゲート41とゲート4
3が開く。またBANK信号30が1のとき、信
号36は1、信号31は信号35と等しくなり、
信号35が0のとき、ゲート41とゲート44が
開き、信号35が1のとき、ゲート41とゲート
43が開く。これにより、特別割り込みベクタが
選択されたとき、BANK信号30が0ならば、
メモリ21が読み出され、メモリ20に書き込む
ことができ、BANK信号30が1ならば、メモ
リ20が読み出され、メモリ21に書き込むこと
ができる。また、特別割り込みベクタが選択され
ない時は、読み書きは、メインメモリ25に対し
て行われる。 既存のプロセツサを、プロセツサ0、プロセテ
ツサ0と、オブジエクトコード上で互換性があ
り、割り込み処理からのリターンアドレスの発生
方の異なるプロセツサを、プロセツサ1とする。 第5図において、プロセツサ0では、命令51
において、特別割り込みが発生した時、その処理
からのリターンアドレスは、次の命令52になつ
ておりプロセツサ1は、命令51において発生し
た、特別割り込みの、処理からのリターンアドレ
スが命令51になつているとする。これでは、プ
ロセツサ1では、命令51においてループしてし
まい、プロセツサ0とまつたく違う動作になつて
しまう、そこで、命令51において発生した割り
込みの、割込みベクタを、ベクタ53のようにリ
ターンアドレス処理ルーチンにしておき、リター
ンアドレス処理ルーチン内において、割り込み処
理からのリターンアドレスを命令52に修正を行
ない、本来の割り込み処理ルーチンに処理を移せ
ば(矢印54)、処理後のリターンアドレスは命
令52になるので、プロセツサ0とプロセツサ2
は見かけ上同じ動作をしたことになる。そこで、
この回路を用いたシステムにおいて、起動時に
BANK信号35を1にしてメモリ21に、リタ
ーンアドレス修正ルーチンの先頭アドレスを書き
込み、BANK信号35を0にする。(100)この
ようにしておくことにより、特別割り込みベクタ
については、リード時には、リターンアドレス修
正ルーチンの先頭アドレスが読み出され、ライト
時には、メモリ20にデータが書き込まれる。 そこで、アプリケーシヨン・プログラム等を実
行する。(101)実行中に、特別割り込みが発生す
ると、特別割り込みベクタが参照されるが、この
時読み出されるのは、メモリ21であり、(102)
リターンアドレス修正ルーチンの先頭アドレスを
指しているので、特別割り込みの処理ルーチンで
はなくて、リターンアドレス修正ルーチンに制御
が移される。(103) リターンアドレス修正ルーチンにおいては、リ
ターンアドレスが等しくなるように、リターンア
ドレスを書き替えておき、BANK信号35を1
にして、メモリ20を読み出す。これにより、本
来の割り込み処理の先頭アドレスを得ることがで
きる。そしてBANK信号を0にし、(104)本来
の割り込み処理ルーチンに制御を移す。(106)こ
れにより、見かけ上同じ動作をされることが可能
になる。すなわち、割り込み処理からのリターン
アドレスの発生方法の違いによる非互換性は解消
される。 次に、80286CPUと8086CPUの場合も具体例と
して説明する。80286CPUは、8086CPUとオブジ
エクトコード上では互換性があるが、0除算割り
込み処理のリターンアドレスの発生法が違うマイ
クロプロセツサである。そのため0除算割り込み
が発生した場合、その割り込み処理、リターンア
ドレスが異なることによる非互換性が発生してい
る。 この非互換性を解消するために、第7図のよう
な回路を用いる。この回路は、アドレスバスAB
2〜AB23がすべて0の時に信号35に0を出
力し、それ以外の時は、信号35に1を出力す
る。0除算割り込みベクタは、メモリアドレスの
0H〜3Hに格納されているので、0除算割り込み
ベクタが選択された時には、信号35に0が出力
され、それ以外のアドレスが選択された時には、
信号35に1が出力される。 また、メモリセレクト回路では、アドレスバス
AB0〜AB3がすべて1で、アドレスバスAB4
〜AB7がすべて0の時で、信号が0から1
になる時のDB0がBANK信号30として出力さ
れる、すなわち、I/OポートOFHに0を出力
するとBANK信号30には0が出力され、I/
OポートOFHに1を出力するとBANK信号30
に1が出力される。この時のメモリマツプを第9
図に示す。 第8図に、この時のメモリマツプを示す、この
図で、メモリ61は80286CPUのメインメモリ、
メモリ62は、メインメモリ61上にある0除算
割り込みベクタの書かれるメモリ、メモリ63
は、メモリ61に対応した動作上問題のないバン
クメモリである。また、第7図において、
は、メインメモリ61に対するメモリ・リード信
号、1はバンクメモリ63に対するメモリ・
リード信号、は、メインメモリ61に対す
るメモリ・ライト信号、1は、バンクメモリ
63に対するメモリ・ライト信号である。 前述したように、第7図の回路では、0除算割
り込みベクタが選択された時、BANK信号30
が0の時は、メモリ・リードに関しては、バンク
メモリ63の内容が読み出され、メモリ・ライト
に関しては、メインメモリ61の0除算割り込み
ベクタ62に書き込まれる。また、BANK信号
30が1の時は、メモリリードに関しては、メイ
ンメモリ61の0除算割り込みベクタ62の内容
が読み出され、メモリ・ライトに関しては、バン
クメモリ63に書き込まれる。仮に、 DIV DX、BX という命令において、BX=0であつたとする
と、80286CPU、8086CPU共に0除算割り込みを
発生するが、その処理ルーチンからのリターンア
ドレスは、80286CPUは割り込みを起こした命令
を指しているが、8086CPUでは、割り込みを起
こした命令の次の命令を指している。もしBX=
0のまま、割り込み処理ルーチンからリターンさ
れると80286CPUでは、再び0除算割り込みを発
生し、プログラムがストツプしてしまう。ところ
が、8086CPUにおいては、処理は割り込みを起
こした命令の次の命令に移つているのでその後の
処理を続行する、というような非互換性が発生し
ています。そこで、80286CPUは0除算割り込み
が発生すると、0除算割り込みベクタを読み出
し、そのベクタの示すアドレスに制御を移す、そ
こで、システムブート時に、I/OポートOFH
に0を出力しておけば、80286CPUが読み出す0
除算割り込みベクタは、バンクメモリ63の値に
することができる。 次に、リターンアドレス修正ルーチンの例の説
明をする。このルーチンのリスリストを第1表に
示す。 このリターンアドレス修正ルーチンは、割り込
みが入つてくると、まず、アプリケーシヨンプロ
グラムの0除算割り込み処理ルーチンへの分岐用
にスタツクエリアを4バイト確保する。(201) 次に、各レジスタの退避を行なう。(202) そして、エラーを起こした命令の先頭アドレス
は、割り込み処理のリターンアドレスになつてい
るので、そのアドレスを、セグメントは、DSレ
ジスタに、オフセツトは、SILレジスタに入れ
る。(203) そして命令コードのプリフイツクス部分をスキ
ツプさせる。(204)プリフイツクス部分は、2進
コードでは、001××110bとなつているのでこの
部分だけスキツプさせる。(205) 次に、割り込みを起こした命令が、除算命令か
どうかを確認する。この場合は、0除算命令は、
2進コードで00×××110bとなつているので割
り込みを起こした命令がこうなつているかを確認
する。(206)もし、0除算命令でなければ、例え
ば1NTO命令ならば、リターンアドレスを修正し
ないまま、アプリケーシユンの割り込み処理ルー
チンに、制御をわたす。(207)除算命令であれ
ば、その命令長を求める。まず、命令の2バイト
目を見て、コードが2進コードで、00×××
110bとなつていれば、メモリオペランド命令で
あるのでこの場合は、4バイト命令、7、6ビツ
目が11又は00の場合は、2バイト命令、7、6ビ
ツト目が01なら3バイト命令、7、6ビツト目が
10なら4バイト命令なので、このことにより、割
り込みを起こした命令の次の命令の先頭がわか
る。(208)これを、リターンアドレスが書き込ま
れているエリアに書き込めば(209)リターンア
ドレスが修正されたことになる。 そして、メインメモリ62の除算割り込みベク
タ62に書き込まれているアプリケーシヨンの0
除算割り込み処理ルーチンのスタートアドレスを
スタツクエリアに分岐用に確保したエリアに書き
込む。(210) そして、レジスタをもどし(211)リターン命
令を実行すると、アプリケーシヨンの0除算割り
込み処理ルーチンに処理を移すことができる。そ
して、そのルーチンからのリターンアドレスは、
0除算割り込みを起こした命令の次のの命令にな
り80286CPUで8086CPUと同様な動作をさせるこ
とが可能になる。 これまで説明した例では、別メモリとして、バ
ンクメモリを用いた例を示したが、別メモリとし
ては、I/Oメモリ、システムの動作上問題のな
いメインメモリ上のメモリ等、どのようなメモリ
を用いてもよい。
[Industrial Application Field] The present invention has object code compatibility with existing microprocessors, and is useful in systems using microprocessors that differ in the way return addresses for interrupt processing are generated. The present invention relates to an information processing device for solving the problem of sexual problems. [Prior Art] Conventionally, there have been microprocessors that are compatible with existing microprocessors in terms of object code, but have different methods of generating return addresses in the same interrupt processing. [Problems to be Solved by the Invention] However, there is a problem in that the same software causes different operations in each microprocessor due to differences in the method of generating return addresses for interrupt processing. SUMMARY OF THE INVENTION In order to solve these conventional problems, it is an object of the present invention to allow each microprocessor to perform the same operation even if an interrupt occurs with a different return address generation method. [Means for Solving the Problem] The present invention includes a detection means for detecting a predetermined interrupt processing, and a return from the interrupt processing that is stored in a first predetermined area of a memory according to the result from the detection means. Return address modification means is activated by return address modification processing activation information for activating address modification processing and executes the return address modification processing; and for activating the interrupt processing from the first predetermined area of the memory to be accessed. memory switching means for switching to a second predetermined area for storing interrupt processing activation information, and when a predetermined interrupt processing is detected, a process for correcting a return address from the interrupt processing and a process for executing the predetermined interrupt processing. It is characterized by [Operation] By adding the device configured as above to a computer, if the start address of the return address correction routine is written in the separate memory mentioned above, the value referenced by the microprocessor will be available when the desired interrupt occurs. can be the beginning of a processing routine. Modify the return address within the processing routine so that it is equal to the return address generated by the same interrupt in the existing microprocessor. By reading another memory, the start address of the original interrupt processing routine can be obtained, so by transferring control there, it is possible to obtain the same operation as a system using an existing microprocessor. can. [Example] First, the principle of the present invention will be explained using FIGS. 1 and 2. First, FIG. 1 will be explained. In the present invention, when a certain value (for example, 01H) is written in area 10 (data flow 113), in order to read out the 01H,
The CPU accesses area 11. (Data flow 114) Then, the read access to area 11 is converted and actually accesses area 10. Further, when a certain value (for example, 02H) is written in area 11 (data flow 116), the CPU accesses area 10 in order to read out the 02H.
(Data flow 115) Then, in the same way as above, access to area 10 is actually accessed to area 11.
02H is read. Here, first, before the predetermined interrupt processing is detected, the CPU writes information for starting the predetermined interrupt processing (for example, the start address of the program that executes the interrupt processing) to the area 10, Information for activating return address modification processing from the interrupt processing (for example, the start address of a program for return address modification processing) is written in area 11. Therefore, when the specified interrupt processing is detected,
When the CPU makes read access to area 10, information for starting the return address correction process in area 11 is actually read, and the return address correction is executed first before interrupt processing. Furthermore, unlike FIG. 1, FIG. 2 shows a case where areas 10 and 11 are interchanged in the write operation. That is, in the case of FIG. 2, in the case of reading, data (data flows 224, 225) can be read from the area designated by the CPU. However, in the case of writing, when area 10 is specified by the CPU, it is actually written to area 11, and when area 11 is specified (data flow 223), it is actually written to area 10. (Data flow 226)
In the case of Fig. 2, the CPU performs write access to area 10 before the predetermined interrupt processing occurs, and actually writes information to start the interrupt processing in area 11, and ,
The CPU performs write access to area 11 and actually writes information in area 10 to start the return address correction process.
Then, when a predetermined interrupt process is detected, area 10 is accessed, and as in FIG.
Return address correction processing is executed. Examples of the present invention are shown below. FIG. 3 is an embodiment of a memory control circuit for implementing the present invention. In FIG. 3, 1 is a special interrupt vector address code circuit, and when the address of the special interrupt vector is selected, the signal 35 is set to 0.
is output, and when another address is selected,
Outputs 1. 2 is a memory select circuit, which determines the BANK signal 30 based on a select signal (not shown) from software. A special interrupt vector is an interrupt vector for an interrupt in which the return address from interrupt processing is generated differently from existing microprocessors. FIG. 4 shows a memory map. In this figure, memory 20 is a special interrupt vector, and memory 21 is another memory that corresponds to memory 20 and has no operational problems. Also, MRN is a memory read signal, MWN is a memory write signal, and 0 is a
a memory read signal for the main memory 25;
MR1 is a memory read signal for the memory 21, MR1 is a memory write signal for the main memory 25, and 1 is a memory write signal for the memory 21. In this circuit, when the BANK signal 30 is 0, the signal 31 is equal to 1, and the signal 36 is equal to the signal 35. When the signal 35 is 0, the gate 42 and the gate 43 are open, and when the signal 35 is 1, the gate 41 and the gate 43 are open. gate 4
3 opens. Also, when the BANK signal 30 is 1, the signal 36 is 1, the signal 31 is equal to the signal 35,
When the signal 35 is 0, the gates 41 and 44 are open, and when the signal 35 is 1, the gates 41 and 43 are open. As a result, when the special interrupt vector is selected, if the BANK signal 30 is 0,
If memory 21 can be read and written to memory 20 and BANK signal 30 is 1, memory 20 can be read and written to memory 21. Further, when a special interrupt vector is not selected, reading and writing are performed to the main memory 25. An existing processor is referred to as processor 0, and a processor that is compatible with processor 0 in terms of object code and that generates a return address from interrupt processing in a different manner is referred to as processor 1. In FIG. 5, in processor 0, instruction 51
When a special interrupt occurs, the return address from the processing is the next instruction 52, and the processor 1 returns the special interrupt that occurred at the instruction 51. Suppose there is. In this case, processor 1 will loop at instruction 51, resulting in a completely different operation from processor 0. Therefore, the interrupt vector of the interrupt that occurred at instruction 51 is changed to vector 53 in the return address processing routine. If you modify the return address from interrupt processing to instruction 52 in the return address processing routine and move the processing to the original interrupt processing routine (arrow 54), the return address after processing will become instruction 52. Therefore, processor 0 and processor 2
appears to have the same behavior. Therefore,
In a system using this circuit, at startup
The BANK signal 35 is set to 1, the start address of the return address correction routine is written in the memory 21, and the BANK signal 35 is set to 0. (100) By doing this, for the special interrupt vector, when reading, the start address of the return address correction routine is read, and when writing, data is written to the memory 20. Then, an application program or the like is executed. (101) When a special interrupt occurs during execution, the special interrupt vector is referenced, but the memory 21 is read at this time, (102)
Since it points to the start address of the return address modification routine, control is transferred to the return address modification routine instead of the special interrupt handling routine. (103) In the return address correction routine, the return addresses are rewritten so that they are equal, and the BANK signal 35 is set to 1.
and read out the memory 20. This makes it possible to obtain the original start address of the interrupt process. Then, the BANK signal is set to 0 (104) and control is transferred to the original interrupt handling routine. (106) This makes it possible to perform apparently the same operation. That is, incompatibilities due to differences in the method of generating return addresses from interrupt processing are resolved. Next, the case of 80286CPU and 8086CPU will be explained as a specific example. The 80286CPU is a microprocessor that is compatible with the 8086CPU in terms of object code, but differs in the way return addresses are generated for divide-by-zero interrupt processing. Therefore, when a divide-by-0 interrupt occurs, incompatibility occurs due to differences in the interrupt processing and return address. In order to eliminate this incompatibility, a circuit as shown in FIG. 7 is used. This circuit uses address bus AB
When all of 2 to AB23 are 0, 0 is output to the signal 35, and 1 is output to the signal 35 at other times. The divide-by-zero interrupt vector is the memory address
Since it is stored in 0H to 3H, when a divide by 0 interrupt vector is selected, 0 is output to signal 35, and when any other address is selected,
1 is output to signal 35. Also, in the memory select circuit, the address bus
AB0 to AB3 are all 1, address bus AB4
~When AB7 is all 0, the signal changes from 0 to 1
DB0 is output as BANK signal 30 when
When outputting 1 to O port OFH, BANK signal 30
1 is output. The memory map at this time is
As shown in the figure. Figure 8 shows the memory map at this time. In this figure, memory 61 is the main memory of the 80286 CPU,
The memory 62 is a memory on the main memory 61 where the divide-by-zero interrupt vector is written, and the memory 63
is a bank memory that corresponds to the memory 61 and has no operational problems. Also, in Figure 7,
is a memory read signal for the main memory 61, and 1 is a memory read signal for the bank memory 63.
A read signal is a memory write signal for the main memory 61, and 1 is a memory write signal for the bank memory 63. As mentioned above, in the circuit of FIG. 7, when the divide-by-0 interrupt vector is selected, the BANK signal 30
When is 0, the contents of the bank memory 63 are read for a memory read, and written to the 0-divide interrupt vector 62 of the main memory 61 for a memory write. Furthermore, when the BANK signal 30 is 1, the contents of the divide-by-zero interrupt vector 62 of the main memory 61 are read for memory read, and written to the bank memory 63 for memory write. If BX = 0 in the instructions DIV DX, BX, both the 80286CPU and 8086CPU will generate a divide-by-zero interrupt, but the return address from the processing routine for the 80286CPU will point to the instruction that caused the interrupt. However, on the 8086 CPU, it points to the instruction following the instruction that caused the interrupt. If BX=
If the interrupt processing routine returns with the value 0, the 80286 CPU will generate a divide-by-0 interrupt again and the program will stop. However, with the 8086CPU, there is an incompatibility in that the processing moves to the next instruction after the instruction that caused the interrupt, and the subsequent processing continues. Therefore, when a divide-by-zero interrupt occurs, the 80286 CPU reads the divide-by-zero interrupt vector and transfers control to the address indicated by that vector.
If you output 0 to , the 80286 CPU will read 0.
The division interrupt vector can be a value in bank memory 63. Next, an example of a return address modification routine will be explained. A list of this routine is shown in Table 1. When an interrupt is received, this return address modification routine first secures a 4-byte stack area for branching to the division-by-zero interrupt processing routine of the application program. (201) Next, each register is saved. (202) Since the start address of the instruction that caused the error is the return address for interrupt processing, that address is stored in the DS register for the segment and the SIL register for the offset. (203) Then, the prefix part of the instruction code is skipped. (204) The prefix part is 001××110b in binary code, so only this part is skipped. (205) Next, check whether the instruction that caused the interrupt is a division instruction. In this case, the divide by 0 instruction is
The binary code is 00×××110b, so check if the instruction that caused the interrupt is like this. (206) If it is not a 0-divide instruction, for example a 1NTO instruction, control is passed to the application's interrupt handling routine without modifying the return address. (207) If it is a division instruction, find the instruction length. First, look at the second byte of the instruction and see that the code is a binary code, 00×××
If it is 110b, it is a memory operand instruction, so in this case, it is a 4-byte instruction, if the 7th and 6th bits are 11 or 00, it is a 2-byte instruction, and if the 7th and 6th bits are 01, it is a 3-byte instruction. 7th and 6th bits
Since 10 is a 4-byte instruction, this allows us to know the beginning of the instruction following the instruction that caused the interrupt. (208) If this is written in the area where the return address is written, (209) the return address will be corrected. Then, the application 0 written in the division interrupt vector 62 of the main memory 62
Write the start address of the division interrupt processing routine to the stack area reserved for branching. (210) Then, by restoring the register (211) and executing a return instruction, processing can be transferred to the application's division-by-zero interrupt processing routine. And the return address from that routine is
This becomes the next instruction after the instruction that caused the divide-by-0 interrupt, allowing the 80286 CPU to operate in the same way as the 8086 CPU. In the examples explained so far, bank memory was used as the separate memory, but the separate memory can be any type of memory, such as I/O memory or memory on main memory that does not cause problems in system operation. may also be used.

【表】【table】

【表】 また、80286CPUにあつて、8086CPUにない割
り込み、例えば、セグメントオーバランエラー割
り込みについて、この割り込みは、 MOV AX:[BX] というような、メモリアクセス命令においてBX
=OFFFFHとなるような、セグメントを超えて、
メモリアクセスしようとした場合、80286CPUで
発生する割り込みである。この割り込みは、
8086CPUでは発生しない。そこで、この場合に
も、本発明を用いリターンアドレス修正ルーチン
内で8086CPUと同様な処理を行い、リターンア
ドレスを割り込みを起こした命令の次にして、リ
ターンすることにより、80286CPUで、8086CPU
と同様な動作をさせることが可能になり、この割
り込みによる非互換性は、この発明を用いること
により解消できる。 [発明の効果] 本発明は、以上詳細に説明したように、検知手
段により所定の割り込み処理を検知するとリター
ンアドレス修正手段を起動して前記所定の割り込
み処理のリターンアドレスを修正するよう構成さ
れるので、 (a) 割り込み処理の異なるプロセツサ間の互換性
が実現できる。そのため、従来は、割り込み処
理の違いのため動かなかつたプロセツサA用の
ソフトウエアがプロセツサBにおいても動くよ
うになり、ユーザーの使い勝手が大幅に向上す
る。 (b) 従来は、多数のソフトを動かすために、プロ
セツサ間の非互換性を考虜して複数のプロセツ
サを有していたが、本発明によれば、唯一のプ
ロセツサで対応でき、装置の簡略化、低価格及
び、実装スペースの節約が実現できる。 (c) 例えば、動作速度の速いプロセツサCと、遅
いプロセツサDがあつた場合、本発明を利用し
てプロセツサD用のソフトウエアをプロセツサ
Cで実行させることにより、従来より高速でソ
フトウエアを実行できるという大きなメリツト
を有する。
[Table] Also, for the 80286CPU, regarding interrupts that the 8086CPU does not have, such as segment overrun error interrupts, this interrupt is
Beyond the segment, such that = OFFFFH,
This is an interrupt that occurs in the 80286 CPU when attempting to access memory. This interrupt is
This does not occur on 8086 CPU. Therefore, in this case as well, the present invention is used to perform the same processing as the 8086CPU in the return address correction routine, and by setting the return address next to the instruction that caused the interrupt and returning, the 80286CPU can
It becomes possible to perform operations similar to those described above, and this incompatibility caused by interrupts can be resolved by using the present invention. [Effects of the Invention] As described in detail above, the present invention is configured such that when the detection means detects a predetermined interrupt process, the return address correction means is activated to correct the return address of the predetermined interrupt process. (a) Compatibility between processors with different interrupt handling can be achieved. Therefore, software for processor A, which conventionally did not work due to differences in interrupt processing, now works on processor B, greatly improving usability for the user. (b) In the past, in order to run a large number of software, multiple processors were required due to the incompatibility between processors, but according to the present invention, only one processor is required, and the device Simplification, low cost, and savings in mounting space can be achieved. (c) For example, if there is a processor C with a fast operating speed and a processor D with a slow operating speed, by using the present invention to execute software for processor D on processor C, the software can be executed faster than before. It has the great advantage of being able to

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

第1図、第2図は、メモリ・リード・ライト制
御回路の動作概念図。第3図は、本発明を実施す
る回路の一例を示す回路図。第4図は、その時の
メモリマツプを示す図。第5図は、割り込み動作
の動作図。第6図は、上記実施例のフローチヤー
トである。第7図は、本発明を実施する具体的な
回路図。第8図は、その時のメモリマツプを示す
図。第9図は、第7図の回路のタイミングチヤー
トを示す図。 113……特別割り込みベクタへのライト時の
データの流れ、114……特別割り込みベクタよ
りのリード時のデータの流れ、115……別メモ
リよりのリード時のデータの流れ、116……別
メモリへのライト時のデータの流れ。
1 and 2 are operational conceptual diagrams of the memory read/write control circuit. FIG. 3 is a circuit diagram showing an example of a circuit implementing the present invention. FIG. 4 is a diagram showing a memory map at that time. FIG. 5 is an operational diagram of interrupt operation. FIG. 6 is a flowchart of the above embodiment. FIG. 7 is a specific circuit diagram for implementing the present invention. FIG. 8 is a diagram showing a memory map at that time. FIG. 9 is a diagram showing a timing chart of the circuit of FIG. 7. 113...Data flow when writing to the special interrupt vector, 114...Data flow when reading from the special interrupt vector, 115...Data flow when reading from another memory, 116...To another memory Data flow when writing.

Claims (1)

【特許請求の範囲】 1 所定の割り込み処理を検知する検知手段と、
該検知手段よりの結果に応じて、メモリの第1所
定エリアに格納される前記割り込み処理からのリ
ターンアドレスの修正処理を起動するためのリタ
ーンアドレス修正処理起動情報により起動され前
記リターンアドレス修正処理を実行するリターン
アドレス修正手段と、 アクセスするメモリを前記第1所定エリアか
ら、前記割り込み処理を起動するための割り込み
処理起動情報を格納する第2所定エリアに切り替
えるメモリ切り替え手段とを有し、 所定の割り込み処理を検知した場合に該割り込
み処理からのリターンアドレスを修正する処理と
前記所定の割り込み処理を実行することを 特徴とする情報処理装置。
[Claims] 1. Detection means for detecting predetermined interrupt processing;
In response to the result from the detection means, the return address modification processing is activated by return address modification processing activation information for activating the return address modification processing from the interrupt processing, which is stored in a first predetermined area of the memory. return address modification means for executing the return address; and memory switching means for switching the memory to be accessed from the first predetermined area to a second predetermined area storing interrupt processing activation information for activating the interrupt processing, An information processing apparatus characterized in that, when an interrupt process is detected, a process of correcting a return address from the interrupt process and the predetermined interrupt process are executed.
JP9676087A 1986-10-03 1987-04-20 Memory controller Granted JPS63233438A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP23570486 1986-10-03
JP61-235704 1986-10-03

Related Child Applications (2)

Application Number Title Priority Date Filing Date
JP1106433A Division JP2569801B2 (en) 1989-04-26 1989-04-26 Information processing device
JP1106432A Division JP2576899B2 (en) 1989-04-26 1989-04-26 Information processing device

Publications (2)

Publication Number Publication Date
JPS63233438A JPS63233438A (en) 1988-09-29
JPH0241771B2 true JPH0241771B2 (en) 1990-09-19

Family

ID=16989991

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9676087A Granted JPS63233438A (en) 1986-10-03 1987-04-20 Memory controller

Country Status (1)

Country Link
JP (1) JPS63233438A (en)

Also Published As

Publication number Publication date
JPS63233438A (en) 1988-09-29

Similar Documents

Publication Publication Date Title
JPH045216B2 (en)
JPH0414385B2 (en)
KR920003044B1 (en) Control system for guest execution of virtual computer system
US4985826A (en) Method and device to execute two instruction sequences in an order determined in advance
JPS6319058A (en) Memory device
JPH0241771B2 (en)
JP2569801B2 (en) Information processing device
US5201052A (en) System for transferring first and second ring information from program status word register and store buffer
JPS6049352B2 (en) data processing equipment
JP2576899B2 (en) Information processing device
JP2619425B2 (en) Sequence controller
JP2671160B2 (en) Exception handling method
JPS6226728B2 (en)
JP2562838B2 (en) Processor and store buffer control method
JP2883488B2 (en) Instruction processing unit
JPH10312307A (en) Emulator for computer system
JPS62254237A (en) Inter-printer type branch instruction executing system
JP2000029508A (en) Programmable controller
JP2574918B2 (en) Interrupt return processing method
JPH1027153A (en) Bus transfer device
JPS60193046A (en) Detecting system for instruction exception
JPS6212555B2 (en)
JPS60159958A (en) Data transfer controlling circuit
JPS58166454A (en) Data processor
JPS61267135A (en) Data processor

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 17

Free format text: PAYMENT UNTIL: 20070919