JPH07210397A - Program conversion method and program execution method using the same - Google Patents

Program conversion method and program execution method using the same

Info

Publication number
JPH07210397A
JPH07210397A JP150994A JP150994A JPH07210397A JP H07210397 A JPH07210397 A JP H07210397A JP 150994 A JP150994 A JP 150994A JP 150994 A JP150994 A JP 150994A JP H07210397 A JPH07210397 A JP H07210397A
Authority
JP
Japan
Prior art keywords
instruction
conversion
program
sequence
routine
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
JP150994A
Other languages
Japanese (ja)
Inventor
Asako Sekine
麻子 関根
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP150994A priority Critical patent/JPH07210397A/en
Publication of JPH07210397A publication Critical patent/JPH07210397A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide program conversion and execution methods for converting an instruction sequence in a first program to an instruction sequence of a second instruction set without analyzing a program. CONSTITUTION:A program conversion part 115 in a program conversion application 113 receives the input of the first program 111, uses an instruction conversion information table 117, acquires a conversion instruction routine number for specifying a conversion instruction routine corresponding to the instruction sequence in the first program and converts the instruction sequence in the first program to the instruction sequence of the second instruction set by using a conversion instruction routine file 119 corresponding to the acquired conversion instruction routine number. Thus, the number of the instructions of the second instruction set to be executed per instruction of the first program is reduced.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、第一の命令セットを有
する第一のプロセッサ用に表された第一のプログラム中
の命令列を、異なる第二の命令セットを有する第二のプ
ロセッサ用の命令列に変換するプログラム変換方法およ
びそれを用いたプログラム実行方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an instruction sequence in a first program represented for a first processor having a first instruction set to a second processor having a different second instruction set. And a program execution method using the program conversion method.

【0002】[0002]

【従来の技術】近年、コンピュータ技術の進歩により、
プロセッサは急速に変化してきている。このため、以前
のプロセッサ用に表されたプログラムが、新しいプロセ
ッサで実行できない事態が生じる。第一のプロセッサを
有する第一のプロセッサ用に表されたプログラムを異な
る第二の命令セットを有する第二のプロセッサで実行す
るためには、第一のプロセッサ用に表されたプログラム
中の命令列を異なる第二のプロセッサ用の命令列に変換
し、第二のプロセッサで実行する方法が有効である。
2. Description of the Related Art In recent years, due to advances in computer technology,
Processors are changing rapidly. As a result, the program represented for the previous processor cannot be executed on the new processor. In order to execute the program represented for the first processor having the first processor by the second processor having a different second instruction set, an instruction sequence in the program represented for the first processor is used. Is converted into an instruction sequence for a different second processor and executed by the second processor.

【0003】例えば、プロシーディング オブ ザ 1
992 エイシーエム インタナショナルコンファレン
ス オン スーパーコンピューティング(Proceeding of
the1992 ACM International Conference on Supercomp
uting(ICS '92),p198〜p215)(公知
例1)では、プログラム実行以前にプログラム解析を行
い、第一のプログラム中の命令列を用意した第二の命令
セットの命令列に変換できる場合は、対応する第二の命
令セットの命令列を実行する命令を埋め込んだプログラ
ムに変換する。そして、第一のプロセッサを模擬するイ
ンタプリタを用意した第二のプロセッサで、変換された
プログラムを実行する。
For example, Proceedings of the 1
992 ACM International Conference on Super Computing (Proceeding of
the1992 ACM International Conference on Supercomp
In uting (ICS '92), p198 to p215) (publicly known example 1), the program analysis can be performed before the program execution, and the instruction sequence in the first program can be converted into the instruction sequence of the prepared second instruction set. Converts into a program in which the instructions for executing the corresponding instruction sequence of the second instruction set are embedded. Then, the converted program is executed by the second processor prepared with an interpreter simulating the first processor.

【0004】ここで、このインタプリタは第二の命令セ
ットの命令列で表されている。その際、対応する第二の
命令セットの命令列がない第一のプログラムの命令列は
インタプリタで実行し、対応する第二の命令セットの命
令列がある第一のプログラムの命令列は対応する第二の
命令セットの命令列を実行する。
Here, this interpreter is represented by an instruction sequence of the second instruction set. At that time, the instruction sequence of the first program having no corresponding instruction sequence of the second instruction set is executed by the interpreter, and the instruction sequence of the first program having the corresponding instruction sequence of the second instruction set corresponds. The instruction sequence of the second instruction set is executed.

【0005】また、特開平2−5139 号公報(公知例2)
では、第一のプログラムの命令フローをグラフ解析し、
第二の命令セットの命令フローに変換し、第二のプロセ
ッサで第一のプログラムをシミュレートしている。
Further, Japanese Patent Laid-Open No. 2-5139 (known example 2)
Then, analyze the instruction flow of the first program by graph,
The instruction flow of the second instruction set is converted, and the first program is simulated by the second processor.

【0006】この方法では、プログラム変換過程でグラ
フ解析により後続の命令が条件コードを使用するかどう
かを検出し、条件コード設定が不要な命令の条件コード
設定処理を省略する。その結果、第一のプログラムの命
令を1命令毎に第二の命令セットの命令列に変換する場
合よりも、第一のプログラムの1命令あたりに実行する
第二の命令セットの命令数が減少し、処理性能が向上す
る。
According to this method, it is detected in the program conversion process by the graph analysis whether or not the subsequent instruction uses the condition code, and the condition code setting process of the instruction which does not need the condition code setting is omitted. As a result, the number of instructions of the second instruction set executed per instruction of the first program is reduced as compared with the case where the instructions of the first program are converted into instruction sequences of the second instruction set for each instruction. However, the processing performance is improved.

【0007】また、特開平2−5140 号公報(公知例3)
では、第一のプログラム中のメモリ更新命令を調べて、
その命令が第一のプログラム中の後続命令を変更するか
どうかを判別し、プログラム実行中に命令が変更された
場合に、変更前の命令に応じて変換された第二の命令セ
ットの命令列を実行されることを防止する。
Further, Japanese Patent Laid-Open No. 2-5140 (known example 3)
Now, check the memory update instruction in the first program,
The instruction sequence of the second instruction set converted according to the instruction before the change is determined if the instruction changes the subsequent instruction in the first program and the instruction is changed during the program execution. To be executed.

【0008】なお、本願明細書においては、「命令列」
を、単数あるいは連続した複数命令を示す用語として使
用する。
In this specification, "instruction sequence"
Is used as a term indicating a single instruction or a plurality of consecutive instructions.

【0009】[0009]

【発明が解決しようとする課題】公知例1では、第一の
プログラムを解析し、第一のプログラム中の命令列が対
応する第二の命令セットの命令列に変換できる場合は、
対応する第二の命令セットの命令列を実行する命令を埋
め込んでいるが、実行以前にプログラム解析が必要であ
る。
In the known example 1, when the first program is analyzed and the instruction sequence in the first program can be converted into the corresponding instruction sequence of the second instruction set,
The instruction for executing the instruction sequence of the corresponding second instruction set is embedded, but the program analysis is required before the execution.

【0010】また、公知例2では、第一のプログラムの
命令フローを解析し、第二のプログラムから不要な処理
を行う命令列を省略することにより実行する命令数を減
少させ、処理性能を向上している。しかし、この場合
も、プログラム解析が必要になる。このように、公知例
1および公知例2とともに、プログラム解析を必要と
し、そのプログラム解析方法は複雑である。
Further, in the known example 2, the instruction flow of the first program is analyzed, and the number of instructions to be executed is reduced by omitting the instruction sequence for performing unnecessary processing from the second program, and the processing performance is improved. is doing. However, also in this case, program analysis is required. As described above, in addition to the known examples 1 and 2, the program analysis is required, and the program analysis method is complicated.

【0011】本発明の第一の目的は、第一の命令セット
を有するプロセッサ用に表された第一のプログラム中の
命令列を異なる第二の命令セットを有する第二のプロセ
ッサ用の命令列に変換するプログラム変換方法で、プロ
グラムを解析することなく、第一のプログラムの命令を
1命令毎に第二の命令セットの命令列に変換する場合よ
りも、第一のプログラムの1命令あたりに実行する第二
の命令セットの命令数を減少させるプログラム変換方法
を提供することにある。
A first object of the present invention is to provide an instruction sequence for a second processor having a second instruction set different from the instruction sequence in the first program represented for the processor having the first instruction set. With the program conversion method for converting into 1 to 1 instructions of the first program, rather than analyzing the instructions of the 1st program into the instruction sequence of the 2nd instruction set without analyzing the program. It is to provide a program conversion method for reducing the number of instructions of the second instruction set to be executed.

【0012】また、公知例3では、第一のプログラム中
のメモリ更新命令を調べることにより、プログラム実行
中に命令が変更された場合に、変更前の命令に応じて変
換された第二の命令セットの命令列が実行されることを
防止しているが、この方法では、メモリ更新命令の調査
が必要になる。
Further, in the known example 3, by checking the memory update instruction in the first program, when the instruction is changed during the execution of the program, the second instruction converted according to the instruction before the change is executed. Although this prevents the set of instruction sequences from being executed, this method requires examination of memory update instructions.

【0013】本発明の第二の目的は、第一の命令セット
を有する第一のプロセッサ用に表された第一のプログラ
ム中の命令列を、異なる第二の命令セットを有する第二
のプロセッサ用の命令列に変換し、第二のプロセッサで
実行するプログラム実行方法で、プログラム中の命令を
調査することなく、プログラム実行中に命令が変換され
た場合、変更前の命令に応じて変換された第二の命令セ
ットの命令列が実行されることを防止するプログラム実
行方法を提供することにある。
A second object of the present invention is to provide a second processor having a different second instruction set from the instruction sequence in the first program represented for the first processor having the first instruction set. If the instruction is converted during the program execution without investigating the instruction in the program by the program execution method that is converted to the instruction sequence for execution by the second processor, it is converted according to the instruction before the change. Another object of the present invention is to provide a program execution method for preventing an instruction sequence of the second instruction set from being executed.

【0014】[0014]

【課題を解決するための手段】前記第一の目的を達成す
るために、本発明のプログラム変換方法では、第一の命
令セットの命令列に対応する変換命令ルーチンと呼ぶ第
二の命令セットの命令列を指定する変換命令ルーチン番
号を有する命令変換情報テーブルを使って、第一のプロ
グラム中の命令列に対応する変換命令ルーチンを指定す
る変換命令ルーチン番号を獲得するステップと、前記変
換命令ルーチンを複数個有する変換命令ルーチンファイ
ルを使って、第一のプログラム中の命令列を第二の命令
セットの命令列に変換するステップとを有し、プログラ
ム変換部が、前記変換命令ルーチン番号に応じて、前記
変換ステップを行う。
In order to achieve the first object, in the program conversion method of the present invention, a second instruction set called a conversion instruction routine corresponding to an instruction sequence of the first instruction set is used. Obtaining a conversion instruction routine number designating a conversion instruction routine corresponding to an instruction string in the first program using an instruction conversion information table having a conversion instruction routine number designating an instruction string; Converting the instruction sequence in the first program into an instruction sequence of the second instruction set by using a conversion instruction routine file having a plurality of conversion instruction routine files. Then, the conversion step is performed.

【0015】また、上記第二の目的を達成するために、
本発明のプログラム実行方法では、前記命令変換情報テ
ーブルを使って、第一のプログラム中の命令列に対応す
る変換命令ルーチンを指定する変換命令ルーチン番号を
獲得するステップと、前記変換命令ルーチンファイルを
使って、第一のプログラム中の命令列を第二の命令セッ
トの命令列に変換するステップと、変換された命令列を
第二のプロセッサで実行するステップとを有し、前記実
行ステップを、第一のプログラム中の命令列が前記プロ
グラム変換方法により第二の命令セットの命令列に変換
される毎に行う。
In order to achieve the second object,
In the program execution method of the present invention, a step of acquiring a conversion instruction routine number designating a conversion instruction routine corresponding to an instruction sequence in the first program using the instruction conversion information table; Using the step of converting the instruction sequence in the first program into the instruction sequence of the second instruction set, and the step of executing the converted instruction sequence in the second processor, the execution step, This is performed every time the instruction sequence in the first program is converted into the instruction sequence of the second instruction set by the program conversion method.

【0016】[0016]

【作用】本発明のプログラム変換方法では、命令変換情
報テーブルを使って、第一のプログラム中の命令列に対
応する変換命令ルーチンを指定する変換命令ルーチン番
号を獲得し、獲得した変換命令ルーチン番号に応じて、
変換命令ルーチンファイルを使って、第一のプログラム
中の命令列を第2の命令セットの命令列に変換する。前
記変換命令ルーチンは、第一のプログラム中の命令列が
複数命令からなる命令列の場合、不要な処理の命令列の
削除、あるいは、第二の命令セットにおける高機能命令
の使用が可能になる。
According to the program conversion method of the present invention, the conversion instruction routine number designating the conversion instruction routine corresponding to the instruction sequence in the first program is acquired using the instruction conversion information table, and the acquired conversion instruction routine number is acquired. In response to the,
The conversion instruction routine file is used to convert the instruction sequence in the first program into the instruction sequence of the second instruction set. In the conversion instruction routine, when the instruction sequence in the first program is an instruction sequence consisting of a plurality of instructions, it is possible to delete an instruction sequence of unnecessary processing or use a high function instruction in the second instruction set. .

【0017】以上より、第一の命令セットを有する第一
のプロセッサ用に表された第一のプログラム中の命令列
を異なる第二の命令セットを有する第二のプロセッサ用
の命令列に変換するプログラム変換方法で、プログラム
を解析することなく、第1のプログラム中の命令を1命
令毎に第二の命令セットの命令列に変換する場合より
も、第一のプログラムの1命令あたりに実行する第二の
命令セットの命令数を減少させることが可能になる。
From the above, the instruction sequence in the first program represented for the first processor having the first instruction set is converted into the instruction sequence for the second processor having the different second instruction set. The program conversion method executes per instruction of the first program, rather than analyzing each instruction in the first program into an instruction sequence of the second instruction set without analyzing the program. It is possible to reduce the number of instructions in the second instruction set.

【0018】また、本発明のプログラム実行方法では、
命令変換情報テーブルを使って、第一のプログラム中の
命令列に対応する変換命令ルーチンを指定する変換命令
ルーチン番号を獲得し、変換命令ルーチンファイルを使
って、第一のプログラム中の命令列が前記プログラム変
換方法により第二の命令セットの命令列に変換される毎
に、変換された命令列を第二のプロセッサで実行する。
また、変換命令ルーチンファイル中に、メモリ更新命令
の後にさらに命令が続くような命令列の変換命令ルーチ
ンを備えなければ、メモリ更新命令が命令を変更した場
合もプログラム実行には影響を与えない。
Further, according to the program execution method of the present invention,
The conversion instruction routine number that specifies the conversion instruction routine corresponding to the instruction string in the first program is obtained using the instruction conversion information table, and the instruction string in the first program is acquired using the conversion instruction routine file. Every time the program is converted into the instruction sequence of the second instruction set by the program conversion method, the converted instruction sequence is executed by the second processor.
Further, if the conversion instruction routine file is not provided with a conversion instruction routine of an instruction string in which a memory update instruction is further followed by an instruction, even if the memory update instruction changes the instruction, it does not affect the program execution.

【0019】以上より、第一の命令セットを有する第一
のプロセッサ用に表された第一のプログラムの命令列を
異なる第二の命令セットを有する第二のプロセッサ用の
命令列に変換し、第二のプロセッサで実行するプログラ
ム実行方法において、プログラム中の命令を調査するこ
となく、プログラム実行中に命令が変更された場合、変
更前の命令に応じて変換された第二の命令セットの命令
列が実行されることを防止することが可能になる。
As described above, the instruction sequence of the first program represented for the first processor having the first instruction set is converted into the instruction sequence for the second processor having a different second instruction set, In the program execution method executed by the second processor, if the instruction is changed during the program execution without investigating the instruction in the program, the instruction of the second instruction set converted according to the instruction before the change It becomes possible to prevent the columns from being executed.

【0020】[0020]

【実施例】まず、第一の実施例として、プログラム変換
方法を説明する。第一の実施例の特徴は、命令順序や変
換命令ルーチン番号等の情報を命令変換情報テーブルか
ら得ることにより、プログラムを解析することなく、第
一のプログラム中の命令列を第二の命令セットの命令列
に変換することにある。
First, a program conversion method will be described as a first embodiment. The feature of the first embodiment is that by obtaining information such as the instruction sequence and the conversion instruction routine number from the instruction conversion information table, the instruction sequence in the first program can be set in the second instruction set without analyzing the program. It is to convert to the instruction sequence of.

【0021】図1は、本発明の一実施例のプログラム変
換システムの概要を示すブロック図である。図1で、1
01はプログラム変換システムへの入力、103はプロ
グラム変換システムのCPU、105はプログラム変換
システムのメモリを示す。
FIG. 1 is a block diagram showing the outline of a program conversion system according to an embodiment of the present invention. In FIG. 1, 1
Reference numeral 01 is an input to the program conversion system, 103 is a CPU of the program conversion system, and 105 is a memory of the program conversion system.

【0022】プログラム変換システムは、第一の命令セ
ットを有する第一のプロセッサ用に表された第一のプロ
グラム111を入力とする。
The program conversion system takes as input a first program 111 represented for a first processor having a first instruction set.

【0023】また、メモリは、第一のプログラム中の命
令列を第二の命令セットの命令列に変換するために、プ
ログラム変換アプリケーション113を備える。プログ
ラム変換アプリケーションは、第一のプログラム中の命
令列を第二の命令セットの命令列に変換する処理を行う
プログラム変換部115と、第一の命令セットの命令列
に対応する変換命令ルーチンと呼ぶ第二の命令セットの
命令列を指定する変換命令ルーチン番号を有する命令変
換情報テーブル117と、変換命令ルーチンを複数個有
する変換命令ルーチンファイル119を有する。
The memory also has a program conversion application 113 for converting the instruction sequence in the first program into the instruction sequence of the second instruction set. The program conversion application is called a program conversion unit 115 that converts an instruction sequence in the first program into an instruction sequence of the second instruction set, and a conversion instruction routine corresponding to the instruction sequence of the first instruction set. It has an instruction conversion information table 117 having a conversion instruction routine number that specifies an instruction sequence of the second instruction set, and a conversion instruction routine file 119 having a plurality of conversion instruction routines.

【0024】プログラム変換部115は、第一のプログ
ラム111から命令列を取り出し、命令変換情報テーブ
ルと変換命令ルーチンファイルを使って、対応する第二
の命令セットの命令に変換し、変換された命令列121
をメモリ内に格納する。
The program conversion unit 115 takes out an instruction sequence from the first program 111, converts it into an instruction of the corresponding second instruction set using the instruction conversion information table and the converted instruction routine file, and converts the converted instruction. Row 121
Is stored in memory.

【0025】図2は、第一のプログラム例を示す図であ
る。第一のプログラム例131において、命令TMは比
較命令であり、比較結果に基づいて条件コードを設定す
る。また、命令BCは条件分岐命令であり、分岐条件が
成立する場合は指定されたアドレスに分岐し、不成立の
場合は後続命令(この例では命令L)を実行する。
FIG. 2 is a diagram showing a first program example. In the first program example 131, the instruction TM is a comparison instruction, and the condition code is set based on the comparison result. The instruction BC is a conditional branch instruction. If the branch condition is satisfied, the instruction BC branches to the designated address, and if not satisfied, the subsequent instruction (instruction L in this example) is executed.

【0026】入力となる第一のプログラム中の命令は、
アセンブラコードのように各命令が識別可能な場合は、
命令番号を命令識別子として各命令に付けておく。な
お、オブジェクトコードのように各命令が識別不可能な
場合は、アドレスを付け、命令の先頭アドレスで各命令
を識別してもよい。以下、第一のプログラムとして、各
命令に命令番号を付けたプログラムを取り上げることに
する。
The command in the first program that is an input is
If each instruction can be identified like assembler code,
An instruction number is attached to each instruction as an instruction identifier. When each instruction cannot be identified like an object code, an address may be attached and each instruction may be identified by the start address of the instruction. Hereinafter, as the first program, a program in which each instruction is given an instruction number will be taken up.

【0027】第一のプログラム中の命令列を第二の命令
セットの命令列に変換するために、プログラム変換アプ
リケーションは、プログラム変換部以外に、命令変換情
報テーブルおよび変換命令ルーチンファイルを保持す
る。
In order to convert the instruction sequence in the first program into the instruction sequence of the second instruction set, the program conversion application holds an instruction conversion information table and a conversion instruction routine file in addition to the program conversion unit.

【0028】図3は、命令変換情報テーブルの例の一部
である。本発明のプログラム変換方法における命令変換
情報テーブルは、対応する変換命令ルーチンを有してい
る第一の命令セットの命令の並びを示す命令順序と、そ
の命令順序に更に命令が続いた命令順序の有無を示す後
続命令の可能性と、その命令順序に対応する変換命令ル
ーチンを指定する変換命令ルーチン番号と、その命令順
序に現われる第一の命令セットの命令数を示す被変換命
令数を情報としてテーブル形式131で定義している。
第一のプログラムの命令にアドレスを付け、命令の先頭
アドレスで各命令を識別している場合は、被変換命令数
に替わるものとして、その命令順序の占めるバイト数等
を与えることも可能である。また、変換命令ルーチンフ
ァイルは、第一の命令セットの命令列に対応する変換命
令ルーチンを複数個有し、各々の変換命令ルーチンは変
換命令ルーチン番号で指定することができる。
FIG. 3 is a part of an example of the instruction conversion information table. The instruction conversion information table in the program conversion method of the present invention includes an instruction sequence indicating a sequence of instructions of the first instruction set having a corresponding conversion instruction routine and an instruction sequence in which the instruction sequence is further followed by instructions. As information, the possibility of the subsequent instruction indicating the presence or absence, the conversion instruction routine number that specifies the conversion instruction routine corresponding to the instruction order, and the number of converted instructions indicating the number of instructions of the first instruction set appearing in the instruction order are used as information. It is defined by the table format 131.
When an address is assigned to the instruction of the first program and each instruction is identified by the start address of the instruction, it is possible to give the number of bytes occupied by the instruction order as an alternative to the number of converted instructions. . Further, the conversion instruction routine file has a plurality of conversion instruction routines corresponding to the instruction sequence of the first instruction set, and each conversion instruction routine can be designated by a conversion instruction routine number.

【0029】ここでは、命令順序として、〔AR r
1,r2〕,〔TM 10(r2),0x55〕,〔TM
10(r2),0x55−BC 0x5,10(r2,r
3)〕,〔L r3,10(r1)〕を定義している。こ
のとき、AR,TM,BC,Lは、命令のニーモニック
であり、〔TM 10(r2),0x55−BC 0x
5,10(r2,r3)〕は「命令〔TM 10(r2),
0x55〕のあとに命令〔BC 0x5,10(r2,
r3)〕が続く」命令順序を示す。
Here, as the instruction sequence, [AR r
1, r2], [TM 10 (r2), 0x55], [TM
10 (r2), 0x55-BC 0x5,10 (r2, r
3)], [L r3,10 (r1)] are defined. At this time, AR, TM, BC, and L are mnemonics of the instruction, and [TM 10 (r2), 0x55-BC 0x.
5, 10 (r2, r3)] is an “instruction [TM 10 (r2),
0x55] followed by the instruction [BC 0x5, 10 (r2,
r3)] follows ”.

【0030】図2の命令変換情報テーブルにおいて、命
令〔TM 10(r2),0x55〕は、更に命令が続い
た命令順序がある可能性を有しており、命令〔TM10
(r2),0x55〕に対応する変換命令ルーチン番号は
ルーチン2であり、被変換命令数は1である。また、命
令列〔TM 10(r2),0x55−BC0x5,10
(r2,r3)〕は、更に命令が続いた命令順序がある可
能性はなく、対応する変換命令ルーチン番号は21であ
り、被変換命令数は2である。
In the instruction conversion information table of FIG. 2, the instruction [TM 10 (r2), 0x55] has a possibility that there is an instruction sequence in which the instructions continue, and the instruction [TM10 (r2), 0x55]
The conversion instruction routine number corresponding to (r2), 0x55] is routine 2, and the number of converted instructions is 1. In addition, the instruction sequence [TM 10 (r2), 0x55-BC0x5, 10
In (r2, r3)], there is no possibility that there is an instruction sequence in which more instructions continue, the corresponding conversion instruction routine number is 21, and the number of converted instructions is 2.

【0031】図4は、変換命令ルーチンファイルの例の
一部である。本発明のプログラム変換方法における変換
命令ルーチンファイルは、第一の命令セットの命令列に
対応する変換命令ルーチンを有している。ここでは、命
令順序として、図3における命令〔TM 10(r2),
0x55〕に対応する変換命令ルーチン番号2の変換命
令ルーチン135と、命令〔TM 10(r2),0x5
5−BC 0x5,10(r2,r3)〕、に対応する変
換命令ルーチン番号21の変換命令ルーチン137を示
している。
FIG. 4 is a portion of an example conversion instruction routine file. The conversion instruction routine file in the program conversion method of the present invention has a conversion instruction routine corresponding to the instruction sequence of the first instruction set. Here, as the instruction sequence, the instruction [TM 10 (r2),
0x55] and the conversion instruction routine 135 of the conversion instruction routine number 2 and the instruction [TM 10 (r2), 0x5
5-BC 0x5,10 (r2, r3)], the conversion instruction routine 137 of the conversion instruction routine number 21 is shown.

【0032】図5は、第一の実施例のプログラム変換処
理を示すフローチャートである。
FIG. 5 is a flow chart showing the program conversion processing of the first embodiment.

【0033】最初に、ステップ(以下Sと記す)301
で変換対象命令番号を1にする。次に、S303で変換
対象命令番号がプログラム変換処理を終了する変換終了
番号に等しいか否かを判定し、等しい場合は、プログラ
ム変換処理を終了し、等しくない場合は、S305以降
の命令変換ルーチン番号獲得処理及び変換処理を実行す
る。
First, step (hereinafter referred to as S) 301
To set the conversion target instruction number to 1. Next, in S303, it is determined whether or not the conversion target instruction number is equal to the conversion end number for ending the program conversion processing. If they are equal, the program conversion processing is ended, and if they are not equal, the instruction conversion routine after S305. The number acquisition process and the conversion process are executed.

【0034】プログラム変換部は、S305において、
第一のプログラムから「変換対象命令番号が指定する命
令」を取り出し、変換対象命令列とする。次に、S30
7において、変換命令情報テーブルで変換対象命令列を
検索し、命令変換情報テーブルに変換対象命令列がある
場合にはS309に、ない場合にはS317に進む。S
309では、変換対象命令列に対応する変換命令ルーチ
ン番号と被変換命令数を変換命令情報テーブルから得
る。そして、S311で、変換対象命令列に後続命令の
可能性があるか否かを変換情報テーブルを使って判定
し、後続命令の可能性がある場合はS313に、ない場
合はS317に進む。S313において、変換対象命令
番号に1を足した値が変換終了番号に等しくない場合は
S315に進み、等しい場合はS321に進む。S31
5においては、「変換対象命令列に次命令を付加した命
令列」を変換対象命令列とし、S307に進み、S30
7以降の処理を行う。
In step S305, the program conversion unit
The “instruction designated by the conversion target instruction number” is taken out from the first program and used as the conversion target instruction sequence. Next, S30
In step 7, the conversion target instruction sequence is searched for in the conversion command information table. If the conversion target command sequence exists in the command conversion information table, the process proceeds to step S309. If not, the process proceeds to step S317. S
At 309, the conversion instruction routine number and the number of converted instructions corresponding to the conversion target instruction sequence are obtained from the conversion instruction information table. Then, in S311, whether or not there is a possibility of a subsequent instruction in the conversion target instruction sequence is determined using the conversion information table. If there is a possibility of a subsequent instruction, the process proceeds to S313, and if not, the process proceeds to S317. In S313, when the value obtained by adding 1 to the conversion target instruction number is not equal to the conversion end number, the process proceeds to S315, and when the value is equal, the process proceeds to S321. S31
In 5, the "instruction string obtained by adding the next instruction to the conversion target instruction string" is set as the conversion target instruction string, and the process proceeds to S307 and S30.
Processing after 7 is performed.

【0035】S307で、命令変換情報テーブルに変換
対象命令列がない場合、あるいは、S311において、
更に命令が続いた命令順序がある可能性がない場合に
は、S317に進むが、S317では、変換命令ルーチ
ン番号の指定する変換命令ルーチンを変換命令ルーチン
ファイルから取り出し、第二の命令セットの命令列に変
換する。そして、S319において、「変換対象命令番
号に被変換命令数を足した値」を変換対象命令番号と
し、S303に進み、S303以降の処理を行う。
In S307, if there is no conversion target instruction sequence in the instruction conversion information table, or in S311,
If there is no possibility that there is an instruction sequence in which further instructions continue, the process proceeds to S317. In S317, the conversion instruction routine specified by the conversion instruction routine number is taken out from the conversion instruction routine file, and the instruction of the second instruction set is acquired. Convert to a column. Then, in S319, the "value obtained by adding the number of converted instructions to the conversion instruction number" is set as the conversion instruction number, the process proceeds to S303, and the processes after S303 are performed.

【0036】S313で、変換対象命令番号に1を足し
た値が変換終了番号に等しい場合は、S321に進む
が、S321では、変換命令ルーチン番号の指定する変
換命令ルーチンを変換命令ルーチンファイルから取り出
し、第二の命令セットの命令列に変換し、プログラム変
換処理を終了する。
If the value obtained by adding 1 to the conversion target instruction number is equal to the conversion end number in S313, the process proceeds to S321. In S321, the conversion instruction routine designated by the conversion instruction routine number is extracted from the conversion instruction routine file. , The instruction sequence of the second instruction set is converted, and the program conversion process is terminated.

【0037】前記プログラム変換方法について、図2で
示した第一のプログラム例中の〔TM 10(r2),0
x55〕と〔BC 0x5,10(r2,r3)〕の命令
列を用いて説明する。
Regarding the program conversion method, [TM 10 (r2), 0 in the first program example shown in FIG. 2 is used.
x55] and [BC 0x5, 10 (r2, r3)] instruction sequences.

【0038】本発明のプログラム変換方法の説明にあた
り、現在の変換対象命令番号は5であるとし、変換終了
番号は100であるとする。また、命令〔TM 10
(r2),0x55〕は条件コードに3を設定し、命令
〔BC 0x5,10(r2,r3)〕は分岐条件が成立
する命令であるとする。また、命令変換情報テーブルは
図3で示した命令変換情報テーブルを、変換命令ルーチ
ンファイルは図4で示した変換命令ルーチンファイルを
使用する。
In describing the program conversion method of the present invention, it is assumed that the current conversion target instruction number is 5 and the conversion end number is 100. In addition, the command [TM 10
(r2), 0x55] sets the condition code to 3, and the instruction [BC 0x5, 10 (r2, r3)] is an instruction that satisfies the branch condition. The instruction conversion information table uses the instruction conversion information table shown in FIG. 3, and the conversion instruction routine file uses the conversion instruction routine file shown in FIG.

【0039】本発明のプログラム変換処理を示す図5の
S303で、現在の変換対象命令番号は5であり、変換
終了番号100とは等しくないため、S305に進む。
In S303 of FIG. 5 showing the program conversion processing of the present invention, the current conversion target instruction number is 5, which is not equal to the conversion end number 100, so the routine proceeds to S305.

【0040】S305で、命令〔TM 10(r2),0
x55〕を変換対象命令列とし、S307で、図3で示
した命令変換情報テーブルで命令〔TM 10(r2),
0x55〕が命令順序としてあるため、S309に進
む。S309において、変換命令ルーチン番号2と被変
換命令数1を変換命令情報テーブルから得る。そして、
S311で、命令〔TM 10(r2),0x55〕は更
に命令が続いた命令順序がある可能性があるので、S3
13に進む。S313において、変換対象命令番号5に
1を足した6が変換終了番号100に等しくないので、
S315に進む。S315で、「変換対象命令列〔TM
10(r2),0x55〕と次命令〔BC 0x5,1
0(r2,r3)〕を続けた命令列」を変換対象命令列と
する。
In S305, the instruction [TM 10 (r2), 0
x55] as the conversion target instruction sequence, and in S307, the instruction [TM 10 (r2), in the instruction conversion information table shown in FIG.
0x55] is the instruction order, the process proceeds to S309. In step S309, the conversion instruction routine number 2 and the converted instruction number 1 are obtained from the conversion instruction information table. And
In step S311, the instruction [TM 10 (r2), 0x55] may have an instruction sequence in which more instructions continue.
Proceed to 13. In S313, since the conversion target instruction number 5 plus 1 is not equal to the conversion end number 100,
Proceed to S315. In step S315, the "conversion target instruction sequence [TM
10 (r2), 0x55] and the next instruction [BC 0x5, 1
0 (r2, r3)] as a sequence of instructions ”is the sequence of instructions to be converted.

【0041】次に、S307で、図3で示した命令変換
情報テーブルで命令列〔TM10(r2),0x55−B
C 0x5,10(r2,r3)〕が命令順序としてある
ため、S309に進む。S309で、変換命令ルーチン
番号21と被変換命令数2を変換命令情報テーブルから
得る。そして、S311で、命令列〔TM10(r2),
0x55−BC 0x5,10(r2,r3)〕は更に命
令が続いた命令順序がある可能性がないので、S317
に進む。
Next, in step S307, the instruction sequence [TM10 (r2), 0x55-B in the instruction conversion information table shown in FIG. 3 is used.
Since C 0x5,10 (r2, r3)] is the instruction order, the process proceeds to S309. In step S309, the conversion instruction routine number 21 and the converted instruction number 2 are obtained from the conversion instruction information table. Then, in S311, the instruction sequence [TM10 (r2),
0x55-BC 0x5,10 (r2, r3)] has no possibility that there is an instruction sequence in which more instructions continue, so S317
Proceed to.

【0042】S317で、変換命令ルーチン番号21の
指定する変換命令ルーチンを図4で示した変換命令ルー
チンファイルから取り出し、第二の命令セットの命令列
に変換する。そして、S319に進み、変換対象命令番
号5に被変換命令数2を足した7を変換対象命令番号と
し、S303に進み、変換対象命令番号7以降の命令の
変換命令ルーチン番号獲得処理及び変換処理を行う。
In step S317, the conversion instruction routine designated by the conversion instruction routine number 21 is fetched from the conversion instruction routine file shown in FIG. 4 and converted into the instruction string of the second instruction set. Then, the process proceeds to S319, where the conversion target command number 5 plus the number of converted commands 2 is 7 is the conversion target command number, and the process proceeds to S303 where the conversion command routine number acquisition process and conversion process for the commands after the conversion target command number 7 are performed. I do.

【0043】図6は図2に示したプログラムにおける
〔TM 10(r2),0x55〕と〔BC 0x5,1
0(r2,r3)〕の命令列を、プログラム解析を行わ
ず、プログラム中の1命令毎に第二の命令セットの命令
列に変換した場合の命令列例141を示す。また図7は
本発明のプログラム変換方法で第二の命令セットの命令
列に変換した場合の命令列例143を示す。
FIG. 6 shows [TM 10 (r2), 0x55] and [BC 0x5, 1 in the program shown in FIG.
0 (r2, r3)] is an instruction sequence example 141 when the instruction sequence is converted into the instruction sequence of the second instruction set for each instruction in the program without performing the program analysis. FIG. 7 shows an instruction sequence example 143 when the program conversion method of the present invention converts into an instruction sequence of the second instruction set.

【0044】図6及び図7において、アスタリスク*を
付けた命令は、命令〔TM10(r2),0x55〕が条
件コード3を設定し、命令〔BC 0x5,10(r
2,r3)〕が成立分岐をする場合に実行する命令であ
ることを示す。1命令毎に変換した場合、実行する命令
が16命令であったのに対し、本発明のプログラム変換
方法により変換した場合は、実行する命令が13命令に
なり、本発明のプログラム変換方法により、第一のプロ
グラムの1命令あたりに実行する第二の命令セットの命
令数が減少したことが分かる。
In FIGS. 6 and 7, the instruction [TM10 (r2), 0x55] sets the condition code 3 and the instruction [BC 0x5, 10 (r
2, r3)] is an instruction executed when a branch is taken. When converted for each instruction, 16 instructions are executed, whereas when converted by the program conversion method of the present invention, 13 instructions are executed, and thus, by the program conversion method of the present invention, It can be seen that the number of instructions of the second instruction set executed per instruction of the first program has decreased.

【0045】1命令毎に変換した場合は、命令〔TM
10(r2),0x55〕の比較処理の結果として条件コ
ードを設定し、命令〔BC 0x5,10(r2,r
3)〕の分岐判定処理として設定された条件コードを分
岐条件に照らしあわせた後、分岐処理を行っている。そ
れに対し、2命令をまとめて変換した場合は、比較処理
と分岐判定処理を第二の命令セットの高機能命令を用い
て同時に行っている。このように、第一のプログラム中
の複数命令をまとめて第二の命令セットの命令列に変換
すると、第一のプログラムの1命令あたりに実行する第
二の命令セットの命令数を減少させることができる。
When the conversion is performed for each instruction, the instruction [TM
10 (r2), 0x55], the condition code is set as a result of the comparison process, and the instruction [BC 0x5, 10 (r2, r
3)], the branch processing is performed after checking the condition code set as the branch determination processing with the branch condition. On the other hand, when the two instructions are collectively converted, the comparison process and the branch determination process are simultaneously performed using the high-performance instruction of the second instruction set. In this way, when a plurality of instructions in the first program are collectively converted into an instruction sequence of the second instruction set, the number of instructions of the second instruction set executed per instruction of the first program can be reduced. You can

【0046】次に、第二の実施例として、プログラム実
行方法を説明する。第二の実施例の特徴は、先述したプ
ログラム変換方法をプログラム実行方法に利用すること
により、第一のプログラムの命令列を第二の命令セット
の命令列に変換する毎に変換された命令列を実行するこ
とにある。
Next, a program execution method will be described as a second embodiment. The feature of the second embodiment is that the instruction sequence converted every time the instruction sequence of the first program is converted into the instruction sequence of the second instruction set by using the above-described program conversion method for the program execution method. To perform.

【0047】図8のブロック図を用いて、本プログラム
実行システムの概要を説明する。図8において、151
はプログラム実行システムへの入力、153はプログラ
ム実行システムのCPU、155はプログラム実行シス
テムのメモリ、157はプログラム実行システムの出力
を保持する磁気メモリを示す。
The outline of the program execution system will be described with reference to the block diagram of FIG. In FIG. 8, 151
Is an input to the program execution system, 153 is a CPU of the program execution system, 155 is a memory of the program execution system, and 157 is a magnetic memory for holding the output of the program execution system.

【0048】プログラム実行システムは、第一の命令セ
ットを有する第一のプロセッサ用に表された第一のプロ
グラム161を入力とする。
The program execution system takes as input a first program 161 represented for a first processor having a first instruction set.

【0049】また、メモリは、第一のプログラム中の命
令列を第二の命令セットの命令列に変換するために、プ
ログラム変換アプリケーション163を備える。プログ
ラム変換アプリケーションは、第一のプログラム中の命
令列を第二の命令セットの命令列に変換する処理を行う
プログラム変換部165と、第一の命令セットの命令列
に対応する変換命令ルーチンと呼ぶ第二の命令セットの
命令列を指定する変換命令ルーチン番号を有する命令変
換情報テーブル167と、変換命令ルーチンを複数個有
する変換命令ルーチンファイル169を有する。
The memory also includes a program conversion application 163 for converting the instruction sequence in the first program into the instruction sequence of the second instruction set. The program conversion application is referred to as a program conversion unit 165 that converts an instruction sequence in the first program into an instruction sequence of the second instruction set and a conversion instruction routine corresponding to the instruction sequence of the first instruction set. It has an instruction conversion information table 167 having a conversion instruction routine number designating an instruction sequence of the second instruction set, and a conversion instruction routine file 169 having a plurality of conversion instruction routines.

【0050】プログラム変換部165は、第一のプログ
ラム161から命令列を取り出し、命令変換情報テーブ
ルと変換命令ルーチンファイルを使って、対応する第二
の命令セットの命令に変換し、変換された命令列171
をメモリ内に格納し、CPU153が変換された命令列
を実行し、プログラム実行結果173を出力する。
The program conversion unit 165 extracts an instruction sequence from the first program 161, converts it into a corresponding instruction of the second instruction set using the instruction conversion information table and the converted instruction routine file, and converts the converted instruction. Row 171
Is stored in the memory, the CPU 153 executes the converted instruction sequence, and outputs the program execution result 173.

【0051】入力となる第一のプログラムには、実施例
1と同様に、各命令に命令番号を付けておく。
As in the first embodiment, the first program to be an input has an instruction number attached to each instruction.

【0052】ここで、本発明のプログラム実行方法にお
ける命令変換情報テーブル及び変換命令ルーチンファイ
ルは、プログラム実行方法における命令変換情報テーブ
ル及び変換命令ルーチンファイルと同様の構成及び内容
である。但し、第二の目的を達成するために、命令変換
情報テーブルの情報である命令順序として、メモリ更新
命令の後にさらに命令が続いた命令順序は指定しない。
Here, the instruction conversion information table and the conversion instruction routine file in the program execution method of the present invention have the same structure and contents as the instruction conversion information table and the conversion instruction routine file in the program execution method. However, in order to achieve the second object, the instruction order, which is the information of the instruction conversion information table, does not specify the instruction order in which the memory update instruction is followed by further instructions.

【0053】図9は、本実施例のプログラム実行処理を
示すフローチャートである。
FIG. 9 is a flow chart showing the program execution processing of this embodiment.

【0054】最初に、S351で変換対象命令番号を1
にする。次に、S353で変換対象命令番号がプログラ
ム変換処理を終了する変換終了番号に等しいか否かを判
定し、等しい場合は、プログラム変換処理を終了し、等
しくない場合は、S355以降の命令変換ルーチン番号
獲得処理,変換処理及び実行処理を実行する。
First, in S351, the conversion target instruction number is set to 1
To Next, in S353, it is determined whether or not the conversion target instruction number is equal to the conversion end number for ending the program conversion processing. If they are equal, the program conversion processing is ended, and if they are not equal, the instruction conversion routine after S355. Executes number acquisition processing, conversion processing, and execution processing.

【0055】プログラム変換部は、S355において、
第一のプログラムから「変換対象命令番号が指定する命
令」を取り出し、変換対象命令列とする。次に、S35
7において、変換命令情報テーブルで変換対象命令列を
検索し、命令変換情報テーブルに変換対象命令列がある
場合にはS359に、ない場合にはS367に進む。S
359では、変換対象命令列に対応する変換命令ルーチ
ン番号と被変換命令数を変換命令情報テーブルから得
る。そして、S361で、変換対象命令列に後続命令の
可能性があるか否かを変換情報テーブルを使って判定
し、後続命令の可能性がある場合はS363に、ない場
合はS367に進む。S363で、変換対象命令番号に
1を足した値が変換終了番号に等しくない場合はS36
5に進み、等しい場合はS373に進む。S365で
は、「変換対象命令列に次命令を付加した命令列」を変
換対象命令列とし、S357に進み、S357以降の処
理を行う。
The program conversion unit, at S355,
The “instruction designated by the conversion target instruction number” is taken out from the first program and used as the conversion target instruction sequence. Next, S35
In step 7, the conversion target instruction sequence is searched for in the conversion command information table. If the conversion target command sequence exists in the command conversion information table, the process proceeds to S359, and if not, the process proceeds to S367. S
At 359, the conversion instruction routine number and the number of converted instructions corresponding to the conversion target instruction sequence are obtained from the conversion instruction information table. Then, in step S361, it is determined whether or not there is a possibility of a subsequent instruction in the conversion target instruction string using the conversion information table. If there is a possibility of a subsequent instruction, the processing proceeds to step S363, and if not, the processing proceeds to step S367. If the value obtained by adding 1 to the conversion target instruction number is not equal to the conversion end number in S363, S36
5, and if they are equal, proceed to S373. In step S365, the "instruction string in which the next instruction is added to the conversion target instruction string" is set as the conversion target instruction string, the process proceeds to step S357, and the processes in and after step S357 are performed.

【0056】S327で、命令変換情報テーブルに変換
対象命令列がない場合、あるいは、S361で、後続命
令の可能性がない場合には、S367に進むが、S36
7では、変換命令ルーチン番号の指定する変換命令ルー
チンを変換命令ルーチンファイルから取り出し、第二の
命令セットの命令列に変換し、変換された命令列をメモ
リに格納する。S369で、プログラム実行部は、変換
された命令列をメモリから取り出し実行する。そして、
S371で、「変換対象命令番号に被変換命令数を足し
た値」を変換対象命令番号とし、S353に進み、S3
53以降の処理を行う。
If there is no conversion target instruction string in the instruction conversion information table in S327, or if there is no possibility of a subsequent instruction in S361, the process proceeds to S367, but S36.
In step 7, the conversion instruction routine designated by the conversion instruction routine number is extracted from the conversion instruction routine file, converted into the instruction string of the second instruction set, and the converted instruction string is stored in the memory. In S369, the program execution unit retrieves the converted instruction sequence from the memory and executes it. And
In S371, "value obtained by adding the number of instructions to be converted to the instruction number to be converted" is set as the instruction number to be converted, and the process proceeds to S353, where S3
The processing after 53 is performed.

【0057】S363で、変換対象命令番号に1を足し
た値が変換終了番号に等しい場合は、S373に進む
が、S373では、変換命令ルーチン番号の指定する変
換命令ルーチンを変換命令ルーチンファイルから取り出
し、第二の命令セットの命令列に変換する。S375
で、プログラム実行部は、変換された命令列を実行し、
プログラム変換処理を終了する。
In S363, if the value obtained by adding 1 to the conversion target instruction number is equal to the conversion end number, the process proceeds to S373, but in S373, the conversion instruction routine designated by the conversion instruction routine number is extracted from the conversion instruction routine file. , To the instruction sequence of the second instruction set. S375
Then, the program execution unit executes the converted instruction sequence,
The program conversion process ends.

【0058】[0058]

【発明の効果】本発明のプログラム変換方法によれば、
第一の命令セットを有する第一のプロセッサ用に表され
た第一のプログラム中の命令列を、異なる第二の命令セ
ットを有する第二のプロセッサ用の命令列に変換するプ
ログラム変換方法において、プログラムを解析すること
なく、第一のプログラムの命令を1命令毎に第二の命令
セットの命令列に変換する場合よりも、第一のプログラ
ムの1命令あたりに実行する第二の命令セットの命令数
を減少させることが可能になる。従って、複雑なプログ
ラム解析方法を必要とすることなく、第二のプロセッサ
において、高速に第一のプログラムを実行することがで
きる。
According to the program conversion method of the present invention,
A program conversion method for converting an instruction sequence in a first program represented for a first processor having a first instruction set into an instruction sequence for a second processor having a different second instruction set, Rather than converting the instructions of the first program into instruction sequences of the second instruction set for each instruction without analyzing the program, the second instruction set of the second instruction set executed per instruction of the first program It becomes possible to reduce the number of instructions. Therefore, the first program can be executed at high speed in the second processor without requiring a complicated program analysis method.

【0059】また、本発明のプログラム実行方法によれ
ば、第一の命令セットを有する第一のプロセッサ用の第
一のプログラムを、異なる第二の命令セットを有する第
二のプロセッサ用の命令列に変換し、第二のプロセッサ
で実行するプログラム実行方法において、プログラムの
命令を調査することなく、プログラム実行中に命令が変
換された場合、変更前の命令に応じて変換された第二の
命令セットの命令列が実行されることを防止することが
可能になる。
Further, according to the program execution method of the present invention, the first program for the first processor having the first instruction set is replaced with the instruction sequence for the second processor having the different second instruction set. In the program execution method of converting to, and executing in the second processor, if the instruction is converted during the program execution without examining the instruction of the program, the second instruction converted according to the instruction before the change It becomes possible to prevent the instruction sequence of the set from being executed.

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

【図1】本発明の第一の実施例のプログラム変換システ
ムの概要を示すブロック図。
FIG. 1 is a block diagram showing an outline of a program conversion system according to a first embodiment of the present invention.

【図2】第一のプログラム例を示す説明図。FIG. 2 is an explanatory diagram showing a first program example.

【図3】命令変換情報テーブル例を示す説明図。FIG. 3 is an explanatory diagram showing an example of an instruction conversion information table.

【図4】変換命令ルーチンファイル例を示す説明図。FIG. 4 is an explanatory diagram showing an example of a conversion instruction routine file.

【図5】第一の実施例のプログラム変換処理を示すフロ
ーチャート。
FIG. 5 is a flowchart showing a program conversion process of the first embodiment.

【図6】1命令毎に変換した場合の命令列例を示す説明
図。
FIG. 6 is an explanatory diagram showing an example of an instruction sequence when converted for each instruction.

【図7】本発明のプログラム変換方法で変換した場合の
命令列例を示す説明図。
FIG. 7 is an explanatory diagram showing an example of an instruction sequence when converted by the program conversion method of the present invention.

【図8】第二の実施例のプログラム実行システムの概要
を示すブロック図。
FIG. 8 is a block diagram showing an outline of a program execution system of a second embodiment.

【図9】第二の実施例のプログラム実行処理を示すフロ
ーチャート。
FIG. 9 is a flowchart showing a program execution process of the second embodiment.

【符号の説明】[Explanation of symbols]

101…プログラム変換システムへの入力、103…プ
ログラム変換システムのCPU、105…プログラム変
換システムのメモリ、111…第1のプログラム、11
3…プログラム変換アプリケーション、115…プログ
ラム変換部、117…命令変換情報テーブル、119…
変換命令ルーチンファイル、121…変換された命令
列。
101 ... Input to program conversion system, 103 ... CPU of program conversion system, 105 ... Memory of program conversion system, 111 ... First program, 11
3 ... Program conversion application, 115 ... Program conversion unit, 117 ... Command conversion information table, 119 ...
Conversion instruction routine file, 121 ... Converted instruction string.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】第1の命令セットを有する第1のプロセッ
サ用に表された第一のプログラム中の命令列を、異なる
第2の命令セットを有する第二のプロセッサ用の命令列
に変換するプログラム変換方法において、 前記第一の命令セットの命令列に対応する変換命令ルー
チンと呼ぶ前記第二の命令セットの命令列を指定する変
換命令ルーチン番号を有する命令変換情報テーブルを使
って、前記第1のプログラム中の命令列に対応する変換
命令ルーチンを指定する変換命令ルーチン番号を獲得す
るステップと、前記変換命令ルーチンを複数個有する変
換命令ルーチンファイルを使って、前記第一のプログラ
ム中の命令列を前記第二の命令セットの命令列に変換す
るステップとを有し、プログラム変換部が前記変換命令
ルーチン番号に応じて、前記変換ステップを行うことを
特徴とするプログラム変換方法。
1. An instruction sequence in a first program represented for a first processor having a first instruction set is converted into an instruction sequence for a second processor having a different second instruction set. In the program conversion method, an instruction conversion information table having a conversion instruction routine number that specifies an instruction string of the second instruction set, which is called a conversion instruction routine corresponding to an instruction string of the first instruction set, is used, A step of obtaining a conversion instruction routine number that specifies a conversion instruction routine corresponding to an instruction sequence in one program; and a conversion instruction routine file having a plurality of the conversion instruction routines, using the instructions in the first program. Converting the sequence into an instruction sequence of the second instruction set, the program conversion unit according to the conversion instruction routine number. A method for converting a program, which comprises performing a conversion step.
【請求項2】第1の命令セットを有する第1のプロセッ
サ用に表された第1のプログラム中の命令列を、異なる
第2の命令セットを有する第2のプロセッサ用の命令列
に変換し、第2のプロセッサで実行するプログラム実行
方法において、 前記第1の命令セットの命令列に対応する変換命令ルー
チンと呼ぶ前記第2の命令セットの命令列を指定する変
換命令ルーチン番号を有する命令変換情報テーブルを使
って、第1のプログラム中の命令列に対応する変換命令
ルーチンを指定する変換命令ルーチン番号を獲得するス
テップと、前記変換命令ルーチンを複数個有する変換命
令ルーチンファイルを使って、第1のプログラム中の命
令列を第2の命令セットの命令列に変換するステップ
と、変換された命令列を第2のプロセッサで実行するス
テップとを有し、第1のプログラム中の命令列が、第2
の命令セットの命令列に変換される毎に前記実行ステッ
プを行うことを特徴とするプログラム実行方法。
2. An instruction sequence in a first program represented for a first processor having a first instruction set is converted into an instruction sequence for a second processor having a different second instruction set. A program execution method executed by a second processor, the instruction conversion having a conversion instruction routine number designating an instruction string of the second instruction set, which is called a conversion instruction routine corresponding to the instruction string of the first instruction set. A step of acquiring a conversion instruction routine number designating a conversion instruction routine corresponding to an instruction sequence in the first program using the information table; and a conversion instruction routine file having a plurality of the conversion instruction routines, And converting the instruction sequence in the first program into an instruction sequence of the second instruction set, and executing the converted instruction sequence on the second processor. And the instruction sequence in the first program is
The program executing method is characterized in that the executing step is performed every time the instruction sequence of the instruction set is converted.
JP150994A 1994-01-12 1994-01-12 Program conversion method and program execution method using the same Pending JPH07210397A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP150994A JPH07210397A (en) 1994-01-12 1994-01-12 Program conversion method and program execution method using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP150994A JPH07210397A (en) 1994-01-12 1994-01-12 Program conversion method and program execution method using the same

Publications (1)

Publication Number Publication Date
JPH07210397A true JPH07210397A (en) 1995-08-11

Family

ID=11503459

Family Applications (1)

Application Number Title Priority Date Filing Date
JP150994A Pending JPH07210397A (en) 1994-01-12 1994-01-12 Program conversion method and program execution method using the same

Country Status (1)

Country Link
JP (1) JPH07210397A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002502516A (en) * 1996-12-31 2002-01-22 ユニシス・コーポレイション Selective emulation interpretation using post-translation instructions
US7299460B2 (en) 2003-05-29 2007-11-20 Nec Corporation Method and computer program for converting an assembly language program for one processor to another
JP2018028777A (en) * 2016-08-17 2018-02-22 Necプラットフォームズ株式会社 Emulation device, emulation method, and emulation program
US11556317B2 (en) 2020-05-22 2023-01-17 Fujitsu Limited Instruction translation support method and information processing apparatus
US11635947B2 (en) 2020-05-22 2023-04-25 Fujitsu Limited Instruction translation support method and information processing apparatus

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002502516A (en) * 1996-12-31 2002-01-22 ユニシス・コーポレイション Selective emulation interpretation using post-translation instructions
US7299460B2 (en) 2003-05-29 2007-11-20 Nec Corporation Method and computer program for converting an assembly language program for one processor to another
JP2018028777A (en) * 2016-08-17 2018-02-22 Necプラットフォームズ株式会社 Emulation device, emulation method, and emulation program
US10268462B2 (en) 2016-08-17 2019-04-23 Nec Platforms, Ltd. Emulation device, emulation method, and recording medium storing emulation program
US11556317B2 (en) 2020-05-22 2023-01-17 Fujitsu Limited Instruction translation support method and information processing apparatus
US11635947B2 (en) 2020-05-22 2023-04-25 Fujitsu Limited Instruction translation support method and information processing apparatus

Similar Documents

Publication Publication Date Title
JP2001236246A (en) Automated regression test of workstation software
JPH08234975A (en) Program generation device and method
JPH07210397A (en) Program conversion method and program execution method using the same
JP3318051B2 (en) Translation processing method
JPH11272503A (en) Device for automatically generating test data of program
US20140173572A1 (en) Constraint derivation in context following for use with object code insertion
JPH09288580A (en) Device and method for optimizing source program
JPH0667871A (en) Automatic program updating system
JP3166699B2 (en) Object-oriented program design support apparatus, method, and recording medium
JPH0411888B2 (en)
JPH04239338A (en) Measuring system for microprogram comprehension rate
JPH0362227A (en) High speed retranslation processing system
McIsaac Combining ALGOL statement analysis with validity checking
JP3208300B2 (en) Method of extracting use form of physical entity in program and related extraction method
JPH10171656A (en) Script language processor
JPH07122880B2 (en) String search method
JPH04287134A (en) Simplified trace information acquisition system
JP3087699B2 (en) Standard information simple input system and standard information simple input method
JP3192686B2 (en) Natural language processing system
JPH05334391A (en) Control circuit generating device
JP2002055854A (en) Computer program measuring device
JPH0553782A (en) System for obtaining dynamic characteristic analysis information of specified part
JP2001282520A (en) Method and device for preparing program and recording medium for program preparation
JPH10207738A (en) Language processing system
JPH04241672A (en) Character string retrieving system