JPH08235019A - Instruction table generation method - Google Patents

Instruction table generation method

Info

Publication number
JPH08235019A
JPH08235019A JP7033776A JP3377695A JPH08235019A JP H08235019 A JPH08235019 A JP H08235019A JP 7033776 A JP7033776 A JP 7033776A JP 3377695 A JP3377695 A JP 3377695A JP H08235019 A JPH08235019 A JP H08235019A
Authority
JP
Japan
Prior art keywords
instruction
definition
generating
character
mask data
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.)
Granted
Application number
JP7033776A
Other languages
Japanese (ja)
Other versions
JP3156537B2 (en
Inventor
Shoji Nagata
昭二 永田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP03377695A priority Critical patent/JP3156537B2/en
Publication of JPH08235019A publication Critical patent/JPH08235019A/en
Application granted granted Critical
Publication of JP3156537B2 publication Critical patent/JP3156537B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE: To provide a method in order to automatically generate an instruction table that can be suitably processed to a general purpose debugger and a general-purpose simulator that are constructed to correspond to the instruction sets of various types of computers by rewriting the instruction table. CONSTITUTION: In the mask data table generation processing 51, 0 is set at the bit position of the corresponding entry of a mask data table corresponding to the character position where a character showing 1 or 0 emerges out of a character pattern in every entry included in an instruction definition body showing the definition of an instruction set and then sets 1 in other cases. In the operation code table generation processing 52, 1 is set at the bit position corresponding to the character position where a character showing 1 emerges out of the character pattern in every entry of the instruction definition body and sets 0 in other cases.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、計算機のプログラムデ
バッグに供するためのデバッガ又はシミュレータに関
し、特に、命令テーブルを書き換えることで、多種類の
計算機の命令セットに対応せしめるべく構成される汎用
デバッガ、汎用シミュレータに対し、好適に処理可能な
命令テーブルを提供する命令テーブル生成方法に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a debugger or a simulator for use in computer program debugging, and more particularly to a general-purpose debugger configured to correspond to a variety of computer instruction sets by rewriting an instruction table, The present invention relates to an instruction table generation method that provides a general-purpose simulator with an instruction table that can be appropriately processed.

【0002】[0002]

【従来の技術】従来の命令テーブル生成に関する技術を
説明する前に、まずデバッガ又はシミュレータの一般的
な構成における命令デコード処理について説明し、次に
汎用デバッガ、汎用シミュレータにおける命令デコード
処理を説明し、最後に汎用デバッガ、汎用シミュレータ
に供する従来の命令テーブル生成方法について説明す
る。
2. Description of the Related Art Before describing a conventional technique related to instruction table generation, an instruction decoding process in a general configuration of a debugger or a simulator will be described first, and then an instruction decoding process in a general-purpose debugger and a general-purpose simulator will be described. Finally, a conventional instruction table generation method used for a general-purpose debugger and a general-purpose simulator will be described.

【0003】まず、命令デコード処理が入力とする計算
機の命令は、一般的に図7に示すように1個のオペコー
ド(以下OPC)フィールドと0個以上のオペランドフ
ィールドから構成される。OPCフィールドは命令の種
別を表し、例えば、ビット4〜7が二進数1101のビ
ットパターンのときMOV命令、ビット4〜7が二進数
1000のビットパターンのときNOP命令を表す、と
いうように定義される。すべての命令はOPCフィール
ドを持つため、命令コードからOPCフィールドを抽出
し、ビットパターンを判定することで、命令種別が一意
に特定される。又、オペランドフィールドは、例えばM
OV命令のとき、ビット2、3でソースレジスタのレジ
スタ番号、ビット0、1でディスティネーションレジス
タのレジスタ番号を表し、NOP命令のときの、ビット
0〜4は未使用フィールドというように定義される。オ
ペランドフィールドにおいては、このように命令毎にレ
ジスタ番号やメモリアドレス、即値あるいは未使用フィ
ールドとしてビットフィールドが分割定義され、命令動
作の詳細情報が表示される。
First, as shown in FIG. 7, an instruction of a computer which is input to the instruction decoding process is generally composed of one opcode (hereinafter referred to as OPC) field and zero or more operand fields. The OPC field represents the type of instruction, and is defined as, for example, a MOV instruction when bits 4 to 7 are a binary 1101 bit pattern and a NOP instruction when bits 4 to 7 are a binary 1000 bit pattern. It Since all instructions have an OPC field, the instruction type is uniquely specified by extracting the OPC field from the instruction code and determining the bit pattern. The operand field is, for example, M
In the OV instruction, bits 2 and 3 represent the register number of the source register, bits 0 and 1 represent the register number of the destination register, and in the NOP instruction, bits 0 to 4 are defined as unused fields. . In the operand field, the bit number is divided and defined as a register number, a memory address, an immediate value or an unused field for each instruction in this way, and detailed information of the instruction operation is displayed.

【0004】デバッガ又はシミュレータの命令デコード
処理は上述したような命令種別とオペランドを命令のビ
ットパターンから判定するための処理を行なう。すなわ
ち、命令コードからOPCフィールドを抽出・判定して
命令種別を特定し、オペランドフィールドを解析して命
令動作の詳細情報を得る処理を行なう。
The instruction decoding process of the debugger or simulator performs the process for determining the instruction type and the operand from the bit pattern of the instruction as described above. That is, the OPC field is extracted and determined from the instruction code to specify the instruction type, and the operand field is analyzed to obtain detailed information of the instruction operation.

【0005】次に汎用デバッガ又は汎用シミュレータに
おける命令デコード処理について、図8を用いて説明す
る。
Next, the instruction decoding process in the general-purpose debugger or general-purpose simulator will be described with reference to FIG.

【0006】図8に示すマスクデータテーブル、オペコ
ードテーブル(以下OPCテーブル)からなる命令テー
ブルには、命令セットの定義に基づき、全ての命令のビ
ットパターンの定義が格納される。例えば、ビット4〜
7が1101のMOV命令が定義される場合、マスクデ
ータテーブルには、ビット4〜7を1、他のビットを0
とした値、即ち二進数11110000の値を持つエン
トリが格納され、同じエントリ位置のOPCテーブルに
は10000000が置かれる。即ち入力された命令の
種別を判定するためのマスクデータテーブルの値と入力
した命令とのAND81を取った後OPCテーブルの値
とEXOR82を取り、結果が0ならばOPC一致とす
るものである。
The instruction table including the mask data table and the operation code table (hereinafter referred to as the OPC table) shown in FIG. 8 stores the bit pattern definitions of all the instructions based on the instruction set definition. For example, bit 4
When a MOV instruction in which 7 is 1101 is defined, bits 4 to 7 are set to 1 and other bits are set to 0 in the mask data table.
Is stored, that is, an entry having a value of the binary number 1110000 is stored, and 10000000 is placed in the OPC table at the same entry position. That is, the AND 81 of the value of the mask data table for judging the type of the input instruction and the input instruction is taken, and then the value of the OPC table and the EXOR 82 are taken.

【0007】更に説明すれば、デバッガ又はシミュレー
タ(汎用デバッガ又は汎用シミュレータを含む)は、命
令デコード処理において命令種別を判定し、更に各命令
毎に定義されるオペランドフィールドを項目(エント
リ)毎に抽出・解析を行ない、例えば、入力の命令が、
命令種別:MOV、オペランド:D0,D1であること
を判定結果とするものである。
To explain further, a debugger or simulator (including a general-purpose debugger or general-purpose simulator) determines an instruction type in an instruction decoding process, and further extracts an operand field defined for each instruction for each item (entry).・ Perform analysis, for example, input command
The determination result is that the instruction type is MOV and the operands are D0 and D1.

【0008】従来の命令テーブル生成方法は上述したマ
スクデータテーブルとOPCテーブルとを人手によって
作成するものであり、更にオペランドデータについては
テーブル定義されず、各命令毎の処理においてオペラン
ドデータの抽出・解析を行なうプログラム作成が必要で
あった。
The conventional instruction table generation method manually creates the above-mentioned mask data table and OPC table. Further, no table is defined for operand data, and the extraction / analysis of operand data is performed in the processing for each instruction. It was necessary to create a program to perform.

【0009】なお、計算機によってはOPCフィールド
の長さが可変長である場合もあるが、同様に処理するこ
とができるため、説明を省略する。
Although the length of the OPC field may be variable depending on the computer, the same processing can be performed, and the description thereof will be omitted.

【0010】[0010]

【発明が解決しようとする課題】しかしながら、前記の
命令テーブル作成によるデバッガ及びシミュレータの汎
用化の方法は、マスクデータテーブル及びOPCテーブ
ルの作成に手間を要し、又オペランドデータについては
各命令毎に抽出・解析を行なう処理をプログラミングす
る必要があるため、計算機毎への対応を行なうのに非常
に手間を要する問題点があった。
However, in the method of generalizing the debugger and the simulator by creating the instruction table described above, it takes a lot of time to create the mask data table and the OPC table, and the operand data is different for each instruction. Since it is necessary to program the process of extracting / analyzing, there is a problem that it takes a lot of time to deal with each computer.

【0011】従って本発明は上記問題点に鑑み、その目
的は命令セットのテーブル定義をより簡単化し、汎用デ
バッガ又は汎用シミュレータの実現を可能ならしめる命
令テーブル生成方法を提供することにある。
SUMMARY OF THE INVENTION Therefore, in view of the above problems, it is an object of the present invention to provide an instruction table generating method that simplifies the instruction set table definition and realizes a general-purpose debugger or a general-purpose simulator.

【0012】[0012]

【課題を解決するための手段】前記の目的を達成するた
め、本発明の第1の命令テーブル生成方法は、命令セッ
トの定義を表現する命令定義体を入力とし、命令定義体
の文字パターンにより命令デコード処理が使用するマス
クデータテーブル作成を行なうマスクデータテーブル生
成処理と、OPCテーブル作成を行なうOPCテーブル
生成処理とを備えた構成とするものであって、マスクデ
ータテーブル生成処理は、命令定義体中の各エントリの
文字パターンから1又は0を表現する文字(例えばJI
Sコードの’1’又は’0’)が現れる文字位置に対応
するマスクデータテーブルの対応する項目(エントリ)
の対応するビット位置に1を置き、その他の場合は0を
置く処理を行なうものであり、OPCテーブル生成処理
は、命令定義体中の各項目(エントリ)の文字パターン
から1が現れる文字位置に対応するビット位置に1を置
き、その他場合は0を置く処理を行なうものである。
In order to achieve the above-mentioned object, a first instruction table generating method of the present invention uses an instruction definition body expressing the definition of an instruction set as an input and uses a character pattern of the instruction definition body. The mask data table generating process for generating a mask data table used by the instruction decoding process and the OPC table generating process for generating an OPC table are provided. Character representing 1 or 0 from the character pattern of each entry in
Corresponding item (entry) in the mask data table corresponding to the character position where the S code "1" or "0" appears.
In the OPC table generation process, 1 is placed in the corresponding bit position of 0, and 0 in other cases. In the OPC table generation process, 1 is placed at the character position where 1 appears from the character pattern of each item (entry) in the instruction definition body. A process of placing 1 in the corresponding bit position and placing 0 in the other cases is performed.

【0013】また、本発明の第2の命令テーブル生成方
法は、オペランドデータの作成を行なうオペランドデー
タ生成処理を備える構成とするものであって、オペラン
ドデータ生成処理は、命令定義体中の各項目(エント
リ)の文字パターンから連続する一文字以上の文字(例
えばJISコードの英字)で構成されるオペランド定義
フィールドを抽出し、オペランドデータの生成を行なう
処理とするものである。
The second instruction table generating method of the present invention comprises an operand data generating process for generating operand data, and the operand data generating process includes each item in the instruction definition body. This is a process of extracting an operand definition field composed of one or more continuous characters (for example, JIS alphabetic characters) from the (entry) character pattern and generating operand data.

【0014】さらに、本発明の命令テーブル生成方法
は、命令定義体の各項目毎に、マスクデータテーブル生
成処理とオペコードテーブル生成処理及びオペランドデ
ータ生成処理とを一連のステップで処理し、命令定義体
の全項目に渡って繰り返し処理することが望ましい。
Further, according to the instruction table generating method of the present invention, the mask data table generating process, the operation code table generating process and the operand data generating process are processed in a series of steps for each item of the instruction defining structure, It is desirable to repeatedly process all items of.

【0015】[0015]

【作用】本発明の第1の構成によれば、マスクデータテ
ーブル生成処理は、前記命令定義体中の各項目の文字パ
ターンから1又は0を表現する文字が現れる文字位置に
対応するマスクデータテーブルの対応するエントリのビ
ット位置に1を置き、その他の場合0を置くステップを
有し、オペコードテーブル生成処理は、前記命令定義体
中の各項目の文字パターンから1を表現する文字が現れ
る文字位置に対応するビット位置に1を置き、その他の
場合0を置くステップを有することにより、マスクデー
タテーブルおよびOPCテーブルは命令定義体の定義に
基づき自動生成される。
According to the first aspect of the present invention, the mask data table generation process is performed by the mask data table corresponding to the character position where the character expressing 1 or 0 appears from the character pattern of each item in the instruction definition body. Of 1 in the bit position of the corresponding entry of 0, and 0 in other cases, and the operation code table generation process is performed at the character position where the character representing 1 appears from the character pattern of each item in the instruction definition body. The mask data table and the OPC table are automatically generated based on the definition of the instruction definition body by including the step of placing 1 in the bit position corresponding to, and 0 otherwise.

【0016】本発明の第2の構成によれば、オペランド
データ生成処理は、前記命令定義体中の各項目の文字パ
ターンから連続する一文字以上の文字で構成されるオペ
ランド定義フィールドを抽出し、オペランドデータの生
成を行なうステップを有することにより、オペランドデ
ータは命令定義体の定義に基づき自動生成される。
According to the second aspect of the present invention, the operand data generation process extracts an operand definition field composed of one or more consecutive characters from the character pattern of each item in the instruction definition structure, and By including the step of generating data, the operand data is automatically generated based on the definition of the instruction definition body.

【0017】[0017]

【実施例】以下本発明の一実施例の命令テーブル生成方
法について、図面を参照しながら説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An instruction table generating method according to an embodiment of the present invention will be described below with reference to the drawings.

【0018】図1は本発明の一実施例における命令テー
ブル生成処理の構成図である。101は命令定義体であ
り、後述するフォーマットに従い人手で作成される命令
セットの定義体である。102の命令テーブル生成処理
は命令定義体101を入力とし、命令テーブル103を
出力する。汎用デバッガ又は汎用シミュレータ105は
命令テーブル103及び被デバッグプログラム104を
入力し、デバッグ情報をスクリーン106に表示する。
命令定義体101、命令テーブル103、被デバッグプ
ログラム104はディスク装置に格納され、命令テーブ
ル生成処理102、汎用デバッガ又は汎用シミュレータ
105は図示せぬ計算機中央処理装置にロードされ実行
される処理である。
FIG. 1 is a block diagram of an instruction table generating process in an embodiment of the present invention. Reference numeral 101 is an instruction definition body, which is a definition body of an instruction set manually created according to a format described later. In the instruction table generation processing of 102, the instruction definition body 101 is input and the instruction table 103 is output. The general-purpose debugger or general-purpose simulator 105 inputs the instruction table 103 and the program to be debugged 104 and displays debug information on the screen 106.
The instruction definition unit 101, the instruction table 103, and the program to be debugged 104 are stored in a disk device, and the instruction table generation process 102, a general-purpose debugger or a general-purpose simulator 105 are processes to be loaded and executed in a computer central processing unit (not shown).

【0019】図2(a)は命令定義体のフォーマットを
示している。命令定義体は各エントリが1個の命令の定
義を表す文字列で構成され、各エントリで図2(b)で
示すように、OPCフィールドとオペランドフィールド
の構成を示す。図2(b)は例としてある計算機が、ビ
ット4〜7が二進数1101のビットパターンのときM
OV命令、ビット4〜7が二進数1000のビットパタ
ーンのときNOP命令であり、MOV命令のときは、ビ
ット2、3でソースレジスタのレジスタ番号、ビット
0、1でディスティネーションレジスタのレジスタ番号
を表し、NOP命令のときは、ビット0〜3は未使用フ
ィールドと定義される命令MOVとNOPを持つ場合、
それぞれに対応して、1101ssdd、1000−−
−−と表されるエントリを持つことを示している。
FIG. 2A shows the format of the instruction definition body. In the instruction definition body, each entry is composed of a character string representing the definition of one instruction, and each entry shows the structure of the OPC field and the operand field as shown in FIG. As an example, FIG. 2B shows that when a computer has bits 4 to 7 of a binary 1101 bit pattern, M
OV instruction is a NOP instruction when bits 4 to 7 are bit patterns of binary 1000, and MOV instruction is a register number of the source register with bits 2 and 3, and a register number of the destination register with bits 0 and 1. In the case of the NOP instruction, bits 0 to 3 have the instruction MOV and NOP defined as unused fields.
Corresponding to each, 1101ssdd, 1000 ---
It is shown that it has an entry represented by-.

【0020】図3は、このように作成される命令定義体
を入力とし、命令テーブル即ち、マスクデータテーブ
ル、OPCテーブル、オペランドデータの生成を出力す
る命令テーブル生成処理について、処理の概略を説明す
る図である。
FIG. 3 outlines the processing of the instruction table generation processing in which the instruction definition body thus created is input and the instruction table, that is, the mask data table, the OPC table, and the generation of the operand data are output. It is a figure.

【0021】まず、入力の命令定義体の各エントリを先
頭よりサーチして、その文字パターンから、1又は0が
現れる文字位置に対応するマスクデータテーブルの対応
するエントリのビット位置に1を置き、そのエントリの
他のビット位置には0を置く。さらに、1が現れる文字
位置に対応するOPCテーブルの対応するエントリに1
を置き、そのエントリの他のビット位置には0を置く。
これを命令定義体の全てのエントリに対して同様の処理
を行なう。このようにしてまず、マスクデータテーブル
及びOPCテーブルが生成される。
First, each entry of the input instruction definition structure is searched from the beginning, and 1 is placed at the bit position of the corresponding entry in the mask data table corresponding to the character position where 1 or 0 appears from the character pattern, Place 0 in the other bit positions of the entry. Furthermore, 1 is set in the corresponding entry of the OPC table corresponding to the character position in which 1 appears.
, And 0s in other bit positions of the entry.
The same processing is performed for all the entries of the instruction definition body. In this way, first, the mask data table and the OPC table are generated.

【0022】このマスクデータテーブルとOPCテーブ
ルとが、汎用デバッガ又は汎用シミュレータによってど
のように使用されるかを説明する前に、図4を用いて、
オペランドデータの生成方法について説明する。
Before explaining how the mask data table and the OPC table are used by a general-purpose debugger or a general-purpose simulator, referring to FIG.
A method of generating operand data will be described.

【0023】図4は、入力の命令定義体の各エントリを
先頭よりサーチして、その文字パターンから、連続する
一文字以上の英字で構成されるオペランド定義フィール
ドを抽出し、オペランドデータの生成を行なう例を示し
ている。オペランド定義フィールドは連続する一文字以
上の英字で構成され、そのビット位置を示す。図4の例
においてはフィールド名ssとddが定義され、フィー
ルドssはビット2、3で示され、フィールドddはビ
ット0、1で示される。フィールドssとddは後述す
るオペランドデータ生成処理によって変数ss定義文と
変数dd定義文とが生成される。それぞれはフィールド
ssやddを命令コードから抽出するためのプログラム
コードであり、マスクデータとシフト量とが含まれる。
例えばフィールドssのため必要なマスクデータは16
進数C0、シフト量は2であり、フィールドddのため
必要なマスクデータは16進数3シフト量であるため、
例えばC言語を対象として、(数1)なる2行のプログ
ラムコードがオペランドデータとして生成される。ここ
でinstは図3で示される、入力の命令コードである。
In FIG. 4, each entry of the input instruction definition is searched from the beginning, and an operand definition field composed of one or more consecutive letters is extracted from the character pattern to generate operand data. An example is shown. The operand definition field is composed of one or more consecutive alphabetic characters and indicates its bit position. In the example of FIG. 4, field names ss and dd are defined, the field ss is indicated by bits 2 and 3, and the field dd is indicated by bits 0 and 1. In the fields ss and dd, a variable ss definition statement and a variable dd definition statement are generated by an operand data generation process described later. Each is a program code for extracting the fields ss and dd from the instruction code, and includes mask data and shift amount.
For example, the mask data required for the field ss is 16
Since the decimal number C0 and the shift amount are 2 and the mask data necessary for the field dd is the hexadecimal number 3 shift amount,
For example, for the C language, two lines of program code (Equation 1) are generated as operand data. Here, inst is the input instruction code shown in FIG.

【0024】[0024]

【数1】 [Equation 1]

【0025】汎用デバッガ又は汎用シミュレータは、そ
の構成要素である命令デコード処理において、前記した
ようなマスクデータテーブル、OPCテーブルのごとき
構成を持つ命令テーブルを参照し、被デバッグプログラ
ムより入力される命令を解析するが、そのアルゴリズム
は既知の技術によって実現される。
The general-purpose debugger or general-purpose simulator refers to an instruction table having a structure such as the mask data table and the OPC table described above in the instruction decoding processing which is a constituent element thereof, and executes an instruction input from the program to be debugged. Parsing, the algorithm is realized by known techniques.

【0026】図5は、図1の命令テーブル生成処理10
2の動作を示す詳細な流れ図であり、命令セットの定義
を表現する命令定義体を入力とし、命令定義体の文字パ
ターンより、命令デコード処理が使用するマスクデータ
テーブルの生成を行なうマスクデータテーブル生成処理
51と、命令定義体の文字パターンより、オペコードテ
ーブル作成を行なうオペコードテーブル生成処理52
と、命令セットの定義を表現する命令定義体を入力と
し、命令定義体の文字パターンより、命令デコード処理
が使用するオペランドデータの生成を行なうオペランド
データ生成処理53を有する。
FIG. 5 shows the instruction table generation process 10 of FIG.
2 is a detailed flow chart showing the operation of No. 2, and a mask data table generation for inputting an instruction definition that expresses the definition of the instruction set and generating a mask data table used by the instruction decoding process from the character pattern of the instruction definition Opcode table generation process 52 for creating an opcode table from the process 51 and the character pattern of the instruction definition
And an operand data generation process 53 for generating an operand data used in the instruction decoding process from a character pattern of the instruction definition structure as an input.

【0027】まず、インデックス値iに1を設定し(ス
テップS501)、iが命令定義体のエントリ数より小
さいかどうかを判定する(ステップS502)。iが命
令定義体のエントリ数を越えたとき、処理終了のステッ
プ(S503)へ分岐する。次にインデックス値jに1
を設定し(ステップS504)、jが命令定義体の各エ
ントリの文字数より小さいかどうかを判定する(ステッ
プS505)。jが命令定義体の各エントリの文字数を
越えたときは、iに1をインクリメントし(ステップS
506)、ステップS502に分岐する。
First, the index value i is set to 1 (step S501), and it is determined whether i is smaller than the number of entries in the instruction definition body (step S502). When i exceeds the number of entries in the instruction definition field, the process branches to the step of ending the process (S503). Then 1 for index value j
Is set (step S504), and it is determined whether j is smaller than the number of characters in each entry of the instruction definition structure (step S505). When j exceeds the number of characters in each entry of the instruction definition field, i is incremented by 1 (step S
506), the process branches to step S502.

【0028】続いて命令定義体のi番目のエントリのj
番目の文字が1又は0かどうかを判定し(ステップS5
07)、yesならば、マスクデータテーブルのi番目
のビット位置に1を格納し(ステップS508)、no
ならば0を格納する(ステップS509)。
Subsequently, j of the i-th entry of the instruction definition field
It is determined whether the th character is 1 or 0 (step S5
07), if yes, 1 is stored in the i-th bit position of the mask data table (step S508), no
If so, 0 is stored (step S509).

【0029】さらに命令定義体のi番目のエントリのj
番目の文字が1かどうかを判定し(ステップS51
0)、yesならば、OPCテーブルのi番目のビット
位置に1を格納し(ステップS511)、noならば0
を格納する(ステップS512)。
Further, j of the i-th entry of the instruction definition field
It is determined whether the th character is 1 (step S51
0), if yes, store 1 in the i-th bit position of the OPC table (step S511), and if no, 0
Is stored (step S512).

【0030】次に命令定義体のi番目のエントリのj番
目の文字が英字かどうかを判定し(ステップS51
3)、yesならば、同一の英字で構成されるオペラン
ド定義フィールドを抽出し(S514)、オペランド生
成処理を呼び出す(ステップS515)。noならば、
それが'-'の文字であるかどうかを判定し(ステップS
516)、noならば、定義されない文字が命令定義体
に含まれているためエラー処理へ分岐する。yesであ
る場合、及びステップS515に続く処理はjをインク
リメントする処理(ステップS517)であり、ステッ
プS505へ戻る。
Next, it is judged whether the j-th character of the i-th entry of the instruction definition is an alphabetic character (step S51).
3) If yes, the operand definition field composed of the same alphabetic characters is extracted (S514), and the operand generation process is called (step S515). If no,
It is determined whether it is a'- 'character (step S
516), if no, an undefined character is included in the instruction definition body, and the process branches to the error processing. If yes and the process following step S515 is a process of incrementing j (step S517), the process returns to step S505.

【0031】又、図6は、オペランドデータ生成処理の
動作を示す流れ図であり、まず、抽出されたフィールド
の文字列から変数名を生成し(ステップS518)、次
にマスクデータ値の生成を行なう(ステップS51
9)。これは具体的には、抽出されたフィールドの英字
に対応するビット位置に1、他のビット位置に0を与え
た値として算出される。次にシフト量の生成を行なう
(ステップS520)。これは具体的には抽出されたフ
ィールドの最後の文字位置に対応するビット位置を最下
位ビットまでシフトするためのシフト量の値としてされ
る。
FIG. 6 is a flow chart showing the operation of the operand data generation process. First, a variable name is generated from the character string of the extracted field (step S518), and then a mask data value is generated. (Step S51
9). Specifically, this is calculated as a value in which 1 is given to the bit position corresponding to the alphabetic character of the extracted field and 0 is given to the other bit positions. Next, the shift amount is generated (step S520). Specifically, this is set as the value of the shift amount for shifting the bit position corresponding to the last character position of the extracted field to the least significant bit.

【0032】以上のような処理を行なうことで、マスク
データテーブル、OPCテーブル及びオペランドデータ
を作成することができる。
The mask data table, the OPC table, and the operand data can be created by performing the above processing.

【0033】なお、本実施例では命令定義体の各エント
リが8文字で構成される場合を示したが、これは各命令
が8ビット長以下であることを前提としている。しかし
ながら、8ビットを越えるビット長に対応し、8文字を
越える長さのエントリで構成しても良い。
In this embodiment, each entry of the instruction definition field is shown to be composed of 8 characters, but it is premised that each instruction has a length of 8 bits or less. However, an entry having a length exceeding 8 characters may be used in correspondence with a bit length exceeding 8 bits.

【0034】また、命令定義体を構成する文字のコード
はJISコード以外であっても良く、さらに二進数0、
1の区別を表し得るための任意の識別子を用いても構成
しても良い。
The code of the characters forming the instruction definition may be other than the JIS code, and the binary number 0,
An arbitrary identifier for indicating the distinction of 1 may be used or configured.

【0035】[0035]

【発明の効果】以上説明したように、本発明に係る命令
テーブル生成方法によると、人手による命令定義体を作
成することにより、命令テーブル生成処理がマスクデー
タテーブル、OPCテーブル及びオペランドデータを自
動生成することができ、汎用デバッガ又は汎用シミュレ
ータに対する命令テーブルとすることができる。計算機
の命令セットの定義に基づき命令定義体を作成すること
は極めて容易であるため、計算機毎の命令セットに対応
した命令テーブルの作成を容易に行なうことができるよ
うになり、その効果は大きい。
As described above, according to the instruction table generating method of the present invention, the instruction table generating process automatically generates the mask data table, the OPC table and the operand data by manually generating the instruction definition body. It can be an instruction table for a general-purpose debugger or a general-purpose simulator. Since it is extremely easy to create the instruction definition body based on the definition of the instruction set of the computer, it becomes possible to easily create the instruction table corresponding to the instruction set of each computer, and the effect is great.

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

【図1】本発明方法の一実施例にかかる計算機の構成ブ
ロック図
FIG. 1 is a configuration block diagram of a computer according to an embodiment of the method of the present invention.

【図2】(a)は同実施例の命令定義体のフォーマット
を示す図 (b)はそのエントリの一例を示す図
FIG. 2A is a diagram showing a format of an instruction definition body of the embodiment, and FIG. 2B is a diagram showing an example of its entry.

【図3】同実施例のマスクデータテーブルとOPCテー
ブルの構成と命令定義体との関連を示す図
FIG. 3 is a diagram showing a relationship between a mask data table and an OPC table configuration and an instruction definition body of the embodiment.

【図4】同実施例のオペランドデータの構成と命令定義
体との関連を示す図
FIG. 4 is a diagram showing a relationship between a structure of operand data and an instruction definition body in the embodiment.

【図5】同実施例の命令テーブル生成処理を示す流れ図FIG. 5 is a flowchart showing an instruction table generating process of the embodiment.

【図6】同実施例のオペランドデータ生成処理を示す流
れ図
FIG. 6 is a flowchart showing an operand data generation process of the same embodiment.

【図7】計算機の命令の構成図FIG. 7 is a block diagram of computer instructions.

【図8】汎用デバッガ又は汎用シミュレータにおける命
令デコード処理を示す流れ図
FIG. 8 is a flowchart showing instruction decoding processing in a general-purpose debugger or general-purpose simulator.

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

101 命令定義体 102 命令テーブル生成処理 103 命令テーブル 104 被デバッグプログラム 105 汎用デバッガ又は汎用シミュレータ 106 デバッガ又はシミュレータのスクリーン 101 instruction definition body 102 instruction table generation processing 103 instruction table 104 debugged program 105 general-purpose debugger or general-purpose simulator 106 debugger or simulator screen

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】デバッガ又はシミュレータの命令デコード
処理が参照するための命令テーブル生成方法であって、 命令セットの定義を表現する命令定義体を入力とし、命
令定義体の文字パターンより、命令デコード処理が使用
するマスクデータテーブルの生成を行なうマスクデータ
テーブル生成処理と、前記命令定義体の文字パターンよ
り、オペコードテーブル作成を行なうオペコードテーブ
ル生成処理とを備え、 前記マスクデータテーブル生成処理は、前記命令定義体
中の各項目の文字パターンから1又は0を表現する文字
が現れる文字位置に対応するマスクデータテーブルの対
応するエントリのビット位置に1を置き、その他の場合
0を置くステップを有し、 前記オペコードテーブル生成処理は、前記命令定義体中
の各項目の文字パターンから1を表現する文字が現れる
文字位置に対応するビット位置に1を置き、その他の場
合0を置くステップを有する命令テーブル生成方法。
1. A method of generating an instruction table for reference by an instruction decoding process of a debugger or a simulator, wherein an instruction definition representing an instruction set definition is input, and an instruction decoding process is performed from a character pattern of the instruction definition. A mask data table generation process for generating a mask data table used by the above, and an operation code table generation process for generating an operation code table from the character pattern of the instruction definition body, wherein the mask data table generation process is performed by the instruction definition. The step of placing 1 at the bit position of the corresponding entry of the mask data table corresponding to the character position where the character expressing 1 or 0 appears from the character pattern of each item in the body, and 0 otherwise. The operation code table generation process is performed by the character pattern of each item in the instruction definition body. 1 placed in the bit positions corresponding to the character position where the character appears to represent the instruction table generation method comprising the steps of placing a 0 otherwise.
【請求項2】デバッガ又はシミュレータの命令デコード
処理が参照するための命令テーブル生成方法であって、 命令セットの定義を表現する命令定義体を入力とし、命
令定義体の文字パターンより、命令デコード処理が使用
するオペランドデータの生成を行なうオペランドデータ
生成処理を備え、 前記オペランドデータ生成処理は、前記命令定義体中の
各項目の文字パターンから連続する一文字以上の文字で
構成されるオペランド定義フィールドを抽出し、オペラ
ンドデータの生成を行なうステップを有する命令テーブ
ル生成方法。
2. A method of generating an instruction table for reference by an instruction decoding process of a debugger or a simulator, wherein an instruction defining body expressing an instruction set definition is input, and an instruction decoding process is performed from a character pattern of the instruction defining body. Operand data generation processing for generating operand data to be used by the operand data generation processing, wherein the operand data generation processing extracts an operand definition field composed of one or more consecutive characters from the character pattern of each item in the instruction definition structure. And an instruction table generating method having a step of generating operand data.
【請求項3】前記マスクデータテーブル生成処理と前記
オペコードテーブル生成処理及び前記オペランドデータ
生成処理とを備え、 前記命令定義体の各項目毎に、前記マスクデータテーブ
ル生成処理と前記オペコードテーブル生成処理及び前記
オペランドデータ生成処理とを一連のステップで処理
し、前記命令定義体の全項目に渡って繰り返し処理する
ことを特徴とする請求項1、2いづれかに記載の命令テ
ーブル生成方法。
3. The mask data table generating process, the opcode table generating process, and the operand data generating process, wherein the mask data table generating process, the opcode table generating process, and the opcode table generating process are performed for each item of the instruction definition body. 3. The instruction table generation method according to claim 1, wherein the operand data generation processing is processed in a series of steps and is repeatedly processed over all items of the instruction definition body.
JP03377695A 1995-02-22 1995-02-22 Instruction table generation method Expired - Fee Related JP3156537B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP03377695A JP3156537B2 (en) 1995-02-22 1995-02-22 Instruction table generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP03377695A JP3156537B2 (en) 1995-02-22 1995-02-22 Instruction table generation method

Publications (2)

Publication Number Publication Date
JPH08235019A true JPH08235019A (en) 1996-09-13
JP3156537B2 JP3156537B2 (en) 2001-04-16

Family

ID=12395860

Family Applications (1)

Application Number Title Priority Date Filing Date
JP03377695A Expired - Fee Related JP3156537B2 (en) 1995-02-22 1995-02-22 Instruction table generation method

Country Status (1)

Country Link
JP (1) JP3156537B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015203895A (en) * 2014-04-11 2015-11-16 三菱電機株式会社 Instruction table generation device, instruction decode program generation device, instruction table generation method, instruction decode program generation method, and program
WO2017009996A1 (en) * 2015-07-16 2017-01-19 三菱電機株式会社 Information processing device, information processing method, and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015203895A (en) * 2014-04-11 2015-11-16 三菱電機株式会社 Instruction table generation device, instruction decode program generation device, instruction table generation method, instruction decode program generation method, and program
WO2017009996A1 (en) * 2015-07-16 2017-01-19 三菱電機株式会社 Information processing device, information processing method, and program
JPWO2017009996A1 (en) * 2015-07-16 2017-10-19 三菱電機株式会社 Information processing apparatus, information processing method, and program

Also Published As

Publication number Publication date
JP3156537B2 (en) 2001-04-16

Similar Documents

Publication Publication Date Title
US7062427B2 (en) Batch editor for netlists described in a hardware description language
EP0735466A2 (en) Method and apparatus for displaying locations of errors detected inside software macro calls
JPS6091450A (en) Table type language interpreter
JPH11191116A (en) System design and evaluation cad system and program storage medium therefor
JP2974900B2 (en) Autonomous evolution hardware design system
KR20010024576A (en) Method for the generation of ISA simulators and assemblers from a machine description
US20050193360A1 (en) Circuit design support system, circuit design support method, and program
JP2004094487A (en) Support system for preparing document
JP3156537B2 (en) Instruction table generation method
JP2760682B2 (en) Hardware design support system
JP4673040B2 (en) Specification data generation method and apparatus
JPH11184900A (en) Scenario display device and method therefor
JPS63109578A (en) Processing system for logic diagram outline display
JPH01184579A (en) Logic circuit design information display device
JP2827724B2 (en) Program debug processing method
JPH0744560A (en) Logical structure recognition processing system in document processor
JPH0628396A (en) Electronic dictionary
JP2825372B2 (en) Hardware structure display device
WO1993015458A1 (en) Information processing apparatus and method therefor
JP3318254B2 (en) How to decrypt files
JPH01108670A (en) Mathematical formula input and edit system
Majewski Introduction to MuPAD
JPH06138913A (en) Programmable controller
JPH07281879A (en) Application program editing device
JPH1010210A (en) Logic simulation device

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080209

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090209

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100209

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100209

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110209

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120209

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees