JP3000878B2 - Assembler processing method - Google Patents

Assembler processing method

Info

Publication number
JP3000878B2
JP3000878B2 JP7040214A JP4021495A JP3000878B2 JP 3000878 B2 JP3000878 B2 JP 3000878B2 JP 7040214 A JP7040214 A JP 7040214A JP 4021495 A JP4021495 A JP 4021495A JP 3000878 B2 JP3000878 B2 JP 3000878B2
Authority
JP
Japan
Prior art keywords
information
optimization
processing
syntax
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP7040214A
Other languages
Japanese (ja)
Other versions
JPH08234998A (en
Inventor
英司 社本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP7040214A priority Critical patent/JP3000878B2/en
Publication of JPH08234998A publication Critical patent/JPH08234998A/en
Application granted granted Critical
Publication of JP3000878B2 publication Critical patent/JP3000878B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明はアセンブラの処理方法に
関し、とくに高速化処理対応のアセンブラの処理方法に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an assembler processing method, and more particularly to an assembler processing method capable of high-speed processing.

【0002】[0002]

【従来の技術】アセンブラソース中のある処理ステップ
位置を参照するためには、その処理ステップのアドレス
を使う参照方法とその位置から現在実行中のある位置へ
の差分による参照方法とが周知である。前者は絶対番地
参照方法と呼ばれ、後者は相対番地参照方法と呼ばれ
る。
2. Description of the Related Art In order to refer to a certain processing step position in an assembler source, a reference method using an address of the processing step and a reference method using a difference from the position to a certain position currently being executed are well known. . The former is called an absolute address reference method, and the latter is called a relative address reference method.

【0003】アセンブラの同じ命令でも絶対番地参照方
法と相対番地参照方法では命令コード長が異なり、相対
番地参照方法の方が命令コード長が短くなる。コード長
が異なる命令の場合はプログラムのコーディングのとき
に選択して指定するか、コンパイラやアセンブラ等の翻
訳プログラムがユーザーの記述した最適化疑似命令をそ
の命令の参照位置によってなるべく短いコード長の命令
に置き換えている。これを命令最適化と呼ぶ。
[0003] Even for the same instruction of the assembler, the instruction code length is different between the absolute address reference method and the relative address reference method, and the instruction code length is shorter in the relative address reference method. Instructions with different code lengths can be selected and specified at the time of program coding, or a translation program such as a compiler or assembler can place an optimization pseudo-instruction written by the user as short as possible according to the reference position of the instruction. Has been replaced. This is called instruction optimization.

【0004】まず高速なアセンブルを行うために命令最
適化はできないが高速にアセンブルができる従来のアセ
ンブラの処理方法について説明する。ここで、定義より
先に参照が行なわれているシンボルを前方参照シンボル
といい、前方参照シンボルの処理を行なうための従来の
アセンブラの処理方法を図12に示す。
First, a description will be given of a conventional assembler processing method capable of performing high-speed assembling but not performing instruction optimization but performing high-speed assembling. Here, a symbol referred to before the definition is called a forward reference symbol, and a conventional assembler processing method for processing the forward reference symbol is shown in FIG.

【0005】図12を参照すると、この従来のアセンブ
ラの処理方法は、入力ファイルとなるソースファイル2
01と、アセンブルの処理を行なうアセンブラ202
と、出力ファイルとなるオブジェクトファイル203と
から構成されている。
Referring to FIG. 12, this conventional assembler processing method uses a source file 2 as an input file.
01 and an assembler 202 that performs assembling processing
And an object file 203 serving as an output file.

【0006】このアセンブラ202の詳細なフローを再
度図12を参照して説明すると、アセンブラ202は、
まずソースファイル入力部204がソースファイル20
1を読む込む。次に、構文解析部205で読み込んだ内
容を構文解析し、シンボルテーブル206と参照情報テ
ーブル207を生成し、解析した内容を中間コード20
8として出力する。シンボルテーブル206はシンボル
定義がった際に作成されるシンボル情報のテーブルであ
り、参照情報テーブル207は前方参照があった際に作
成される参照情報のテーブルであり、中間コード208
はソースプログラムを機械語コードに変換したコードで
ある。アセンブラ202は、構文解析部205の処理を
終了後、オペランド決定処理部209でシンボルテーブ
ル206、参照情報テーブル207を使って、前方参照
によって未決定であった中間コード208のオペランド
を解決し、オブジェクトコードを作成し、オブジェクト
コード203をオブジェクトファイル出力部210で出
力する。
The detailed flow of the assembler 202 will be described with reference to FIG. 12 again.
First, the source file input part 204
Read 1. Next, the syntax read by the syntax analysis unit 205 is analyzed, a symbol table 206 and a reference information table 207 are generated, and the analyzed content is stored in the intermediate code 20.
Output as 8. The symbol table 206 is a table of symbol information created when a symbol is defined. The reference information table 207 is a table of reference information created when a forward reference is made.
Is a code obtained by converting a source program into machine language code. After finishing the processing of the syntax analysis unit 205, the assembler 202 uses the symbol table 206 and the reference information table 207 in the operand determination processing unit 209 to resolve the operand of the intermediate code 208 that has not been determined by forward reference, and A code is created, and the object code 203 is output by the object file output unit 210.

【0007】上述したシンボルテーブル206、参照情
報207、および中間コード208のそれぞれの詳細を
図13を参照して説明する。
Details of each of the above-described symbol table 206, reference information 207, and intermediate code 208 will be described with reference to FIG.

【0008】まず、n個のシンボル定義とk個の前方参
照が入力されたアセンブラソース中の記述されている
時、シンボルテーブル301にはシンボルエントリ(3
011〜301n)が作成され、参照情報テーブル30
2には参照情報エントリ(3021〜302k)が作成
される。各シンボルエントリ(3011〜301n)は
そのシンボルが定義されたアドレス値を持ち、参照情報
は参照しているシンボルエントリへのポインタと参照位
置の中間コード303への位置を有する。
First, when n symbol definitions and k forward references are described in the input assembler source, a symbol entry (3
01-301n) are created and the reference information table 30
2, reference information entries (3021 to 302k) are created. Each symbol entry (301 to 301n) has an address value in which the symbol is defined, and the reference information has a pointer to the symbol entry being referred to and a reference position of the reference position to the intermediate code 303.

【0009】さらに、構文解析部205のフローについ
て図14に示すフローチャートを参照して説明する。
Further, the flow of the syntax analysis unit 205 will be described with reference to the flowchart shown in FIG.

【0010】まず、構文処理401で構文の解析を行な
う。次に前方参照判定処理402でオペランドに前方参
照シンボルがあるなら、参照情報生成処理403を行な
い、終了判定処理404を行なう。参照情報生成処理4
03では参照情報テーブルに参照情報の生成を行なう。
終了判定処理404では構文がまだあるか否かの判定を
行ない、構文がまだあれば構文処理401に戻り、そう
でなければ構文解析を終了する。
First, syntax analysis is performed in syntax processing 401. Next, if there is a forward reference symbol in the operand in the forward reference determination processing 402, reference information generation processing 403 is performed, and end determination processing 404 is performed. Reference information generation processing 4
In step 03, reference information is generated in the reference information table.
In the end determination process 404, it is determined whether or not there is a syntax. If there is a syntax, the process returns to the syntax process 401; otherwise, the syntax analysis ends.

【0011】次に、オペランド決定処理部209のフロ
ーについて図15に示すフローチャートを参照して説明
する。
Next, the flow of the operand determination processing unit 209 will be described with reference to the flowchart shown in FIG.

【0012】オペランド決定処理部209は参照情報テ
ーブル中の参照情報エントリを先頭から一つずつ処理を
行なう。まず参照情報終了判定処理501を行なう。こ
の参照情報終了判定処理501では参照位置に参照情報
がまだあるか否かの判定し、まだあれば参照情報解決処
理502を行ない、そうでなければオペランド決定処理
部を終了する。
The operand determination processing unit 209 processes reference information entries in the reference information table one by one from the top. First, reference information end determination processing 501 is performed. In this reference information end determination processing 501, it is determined whether or not reference information is still present at the reference position. If there is, reference information resolution processing 502 is performed; otherwise, the operand determination processing unit ends.

【0013】参照情報解決処理502では、現在参照中
の参照情報が指しているシンボルからアドレス値を取り
だしそのアドレス値を参照情報が指している中間コード
の位置へ埋め込み、パッチを行ない、参照位置変更処理
503を行なう。参照位置変更処理503では参照情報
の参照位置の次の参照情報の位置に変更し、参照情報終
了判定処理501に戻る。
In the reference information resolution process 502, an address value is extracted from the symbol pointed to by the reference information currently being referenced, the address value is embedded in the position of the intermediate code pointed to by the reference information, a patch is performed, and the reference position is changed. Processing 503 is performed. In the reference position change processing 503, the reference information is changed to the position of the reference information next to the reference position of the reference information, and the process returns to the reference information end determination processing 501.

【0014】次に、命令最適化はできるが先に説明した
アセンブラの処理方法ほどは高速ではない従来の第2の
アセンブラの処理方法について説明する。
Next, a description will be given of a second conventional assembler processing method which can perform instruction optimization but is not as fast as the assembler processing method described above.

【0015】図16を参照すると、命令最適化処理を行
なう従来の第2のアセンブラの処理方法は、入力ファイ
ルとなるソースファイル601と、アセンブルの処理を
行なうアセンブラ602と、出力ファイルとなるオブジ
ェクトファイル603とから構成されている。
Referring to FIG. 16, a second conventional assembler processing method for performing instruction optimization processing includes a source file 601 as an input file, an assembler 602 to perform assembling processing, and an object file as an output file. 603.

【0016】このアセンブラ602の詳細なフローを再
度図16を参照して説明すると、アセンブラ602は、
まずソースファイル入力部604がソースファイル60
1を読み込む。次に、構文解析部605で読み込んだ内
容を構文解析し、シンボルテーブル606、最適化情報
607を作成し、解析した内容を中間データ608を作
成する。構文解析部605中の分岐情報生成部6051
によって構文が最適化疑似命令であった時に最適化情報
を作成する。シンボルテーブル606はシンボル定義が
あった際に作成されるシンボル情報のテーブルであり、
分岐情報607は最適化疑似命令があった際に作成され
る最適化情報のテーブルであり、中間データ608はソ
ースプログラムを解析し、解析した情報を1行ごとにコ
ード生成をしやすい情報に変更したデータである。構文
解析終了後、最適化処理部609でシンボルテーブル6
06と分岐情報607を用いて最適化処理を行ない、シ
ンボルテーブル606を更新する。中間データ解析部6
10でシンボルテーブル606を用いて中間データ60
8の解析を行ない、オブジェクトコードを作成し、オブ
ジェクトコードをオブジェクトファイル出力部611で
出力する。
The detailed flow of the assembler 602 will be described with reference to FIG. 16 again.
First, the source file input unit 604
Read 1 Next, the content read by the syntax analysis unit 605 is syntax-analyzed, a symbol table 606 and optimization information 607 are created, and the analyzed content is created as intermediate data 608. Branch information generation unit 6051 in syntax analysis unit 605
Creates optimization information when the syntax is an optimization pseudo-instruction. The symbol table 606 is a table of symbol information created when a symbol is defined.
The branch information 607 is a table of optimization information created when there is an optimization pseudo-instruction. The intermediate data 608 analyzes a source program, and changes the analyzed information into information that facilitates code generation for each line. Data. After the completion of the syntax analysis, the optimization processing unit 609 uses the symbol table 6
The optimization process is performed using the information 06 and the branch information 607, and the symbol table 606 is updated. Intermediate data analyzer 6
10, the intermediate data 60 is generated using the symbol table 606.
8 is performed, an object code is created, and the object code is output by the object file output unit 611.

【0017】中間データ608の詳細を図17に示す。
アセンブラソース中にn行のインストラクションが記述
されている時、中間データ701にはデータエントリ
(7011〜701n)が作成される。
The details of the intermediate data 608 are shown in FIG.
When n lines of instructions are described in the assembler source, data entries (7011-701n) are created in the intermediate data 701.

【0018】データエントリ(7011〜701n)は
それぞれインストラクション識別値(70111〜70
1n1)を持つ。インストラクション識別値には決定
(1とする)か未決定(0とする)かの情報がはいる。
その行のインストラクションが構文解析された時点で決
定できるなら決定の情報(1)がはいり、その行のイン
ストラクションが構文解析された時点で決定できないな
ら未決定の情報が入る。決定の時にはデータエントリに
は決定されたオブジェクトコードが格納される。未決定
の時にはデータエントリには未決定なオブジェクトコー
ドとオブジェクトコードを決定するために必要なオペラ
ンドの値が中間参照情報として格納される。
The data entries (7011-701n) have instruction identification values (7011-170), respectively.
1n1). The instruction identification value includes information indicating whether it is determined (set to 1) or not determined (set to 0).
If the instruction of the line can be determined at the time of parsing, the decision information (1) is inserted. If the instruction of the line cannot be determined at the time of parsing, undetermined information is entered. At the time of determination, the determined object code is stored in the data entry. When not determined, the data entry stores the undetermined object code and the value of the operand necessary for determining the object code as intermediate reference information.

【0019】中間参照情報は参照位置情報と参照シンボ
ル情報を持つ。参照位置情報はそのオペランドが参照さ
れているオブジェクトコード中の位置で、参照シンボル
情報はそのオペランドが参照しているシンボルエントリ
へのポインタを持つ。
The intermediate reference information has reference position information and reference symbol information. The reference position information is a position in the object code where the operand is referenced, and the reference symbol information has a pointer to the symbol entry referenced by the operand.

【0020】構文解析部605のフローチャートを図1
8に示す。
FIG. 1 is a flowchart of the syntax analysis unit 605.
FIG.

【0021】図18を参照すると、構文解析部605
は、構文処理801で入力されたアセンブラソースから
一行ごとの構文の解析を行なう。次に、意味解析処理8
02では構文から意味の解析を行ない、記述された行に
対してどのようなオブジェクトコードを出力すればよい
か解析を行なう。ただし、この意味解析処理802では
実際にはオブジェクトコードの出力は行なわないが、ど
のようなオブジェクトコードを出力すればよいかという
解析は、アドレスの決定のために必要である。意味解析
部で「end」が記述されたように解析されたなら、構
文解析部の処理を終了し、そうでなければオブジェクト
コード解決判定処理を行なう。ただし「end」はen
d疑似命令で構文の終りであることを示す疑似命令とす
る。
Referring to FIG. 18, the syntax analyzer 605
Analyzes the syntax of each line from the assembler source input in the syntax processing 801. Next, semantic analysis processing 8
In 02, the meaning is analyzed from the syntax, and what kind of object code should be output for the described line is analyzed. However, in the semantic analysis processing 802, the object code is not actually output, but an analysis of what kind of object code should be output is necessary for determining the address. If the semantic analysis unit has analyzed “end” as described, the processing of the syntax analysis unit ends, and if not, the object code solution determination processing is performed. Where "end" is en
This is a pseudo-instruction that indicates the end of the syntax with the d pseudo-instruction.

【0022】次に、オブジェクトコード決定判定処理8
03でオブジェクトコードが決定できるかどうかを判定
する。もしオペランドの値が現時点ではわかっており、
オブジェクトコードが決定できるなら、決定中間言語デ
ータ作成処理804を行ない、そうでないなら、未決定
中間言語データ作成処理805を行なう。決定中間言語
データ作成処理804ではインストラクション識別子と
して決定の情報を出力し、そのあと決定されたオブジェ
クトコードを出力し、終了判定処理806を行なう。未
決定中間言語データ作成処理805ではインストラクシ
ョン識別子として未決定の情報を出力し、そのあと未決
定のオブジェクトコードを出力し、オペランドの情報を
中間参照情報として出力し、終了判定処理806を行な
う。終了判定処理806では構文がまだあるか否かの判
定を行ない、構文解析を終了する。
Next, an object code determination determination process 8
At 03, it is determined whether the object code can be determined. If the value of the operand is currently known,
If the object code can be determined, the determined intermediate language data creation processing 804 is performed; otherwise, the undetermined intermediate language data creation processing 805 is performed. In the determined intermediate language data creation processing 804, information of the determination is output as the instruction identifier, and then the determined object code is output, and the end determination processing 806 is performed. In the undetermined intermediate language data creation processing 805, undetermined information is output as an instruction identifier, an undetermined object code is output, operand information is output as intermediate reference information, and an end determination processing 806 is performed. In the end determination processing 806, it is determined whether or not there is a syntax, and the syntax analysis ends.

【0023】次に、中間データ解析部610のフローチ
ャートを図19に示す。
Next, FIG. 19 shows a flowchart of the intermediate data analysis section 610.

【0024】識別値判定処理901で中間データのイン
ストラクション識別値の判定を行ない、決定の情報が入
っていたらオブジェクト出力処理903を行ない、そう
でなければ、オブジェクト決定処理902を行なう。オ
ブジェクト決定処理902では参照シンボル情報が指し
ているシンボルエントリの値を参照位置情報に入ってい
るオブジェクトコードの参照位置に出力してオブジェク
トコードの決定を行ない、オブジェクト出力処理903
を行なう。次にオブジェクト出力処理03を行なう。オ
ブジェクト出力終了903ではデータエントリ中のオブ
ジェクトコードの出力を行ない、終了判定処理904を
行なう。終了判定処理904ではデータエントリがまだ
あるか否かの判定を行ない、データエントリがまだあれ
ば識別値判定処理901に戻り、そうでなければ中間デ
ータ解析を終了する。
In the identification value determination processing 901, the instruction identification value of the intermediate data is determined. If the information of the determination is included, the object output processing 903 is performed. Otherwise, the object determination processing 902 is performed. In the object determination processing 902, the value of the symbol entry pointed to by the reference symbol information is output to the reference position of the object code included in the reference position information to determine the object code, and the object output processing 903
Perform Next, an object output process 03 is performed. In the object output end 903, the object code in the data entry is output, and the end determination processing 904 is performed. In the end determination process 904, it is determined whether or not there is a data entry. If there is a data entry, the process returns to the identification value determination process 901; otherwise, the intermediate data analysis ends.

【0025】具体的な例として図20のアセンブラソー
スが入力されたときの構文解析部605と中間データ解
析部610の動作を説明する。図10には3行からなる
アセンブラソースで「lab:」はラベル定義命令であ
り、「mov A,X」はオブジェクトコード「000
1」であるとし、「mov A,lab」はオブジェク
トコード「10XX」であり、「end」はend疑似
命令で構文の終りであることを示す疑似命令とする。た
だしXXにはlabの相対アドレスが入るとする。
The operation of the syntax analyzer 605 and the intermediate data analyzer 610 when the assembler source shown in FIG. 20 is input will be described as a specific example. In FIG. 10, "lab:" is a label definition instruction in an assembler source consisting of three lines, and "mov A, X" is an object code "000".
"1", "mov A, lab" is an object code "10XX", and "end" is an end pseudo instruction which indicates the end of the syntax. However, it is assumed that XX contains the relative address of lab.

【0026】次に、構文解析部605では図21に示す
中間データが作成される。まず構文処理801で「mo
v A,lab」という構文が入力されたことを解析す
る。次に意味解析処理802では「mov A,la
b」の構文の意味を解析し、オブジェクトコード「10
XX」を出力すればよいという解析を行なう。次にオブ
ジェクトコード決定判定処理803でオブジェクトコー
ドが決定できるかどうかを判定する。中間言語データ作
成処理803で中間言語の作成を行なう。この場合では
オブジェクトコードは未決定であるので未決定中間言語
データ作成処理805を行なう。
Next, the syntax analyzer 605 creates the intermediate data shown in FIG. First, in syntax processing 801, “mo
It analyzes that the syntax “v A, lab” has been input. Next, in the semantic analysis processing 802, “mov A, la
b), the object code “10” is analyzed.
XX "is output. Next, it is determined whether or not an object code can be determined in an object code determination determination process 803. In the intermediate language data creation processing 803, an intermediate language is created. In this case, since the object code has not been determined, the undetermined intermediate language data creation processing 805 is performed.

【0027】未決定中間言語データ作成処理805では
インストラクション識別子110111として未決定の
情報を出力し、そのあと未決定のオブジェクトコード1
10112を出力し、オペランドの情報を中間参照情報
110113として出力する。ここでは中間生成情報1
10113中の参照位置情報1101131に1が入
り、参照シンボル情報1101132には「lab」の
シンボルエントリへのポインタが格納され、構文処理8
01に戻る。
In the undecided intermediate language data creation processing 805, undecided information is output as the instruction identifier 110111.
10112, and outputs the information of the operand as the intermediate reference information 110113. Here, the intermediate generation information 1
In the reference position information 1101131 in 10113, 1 is entered, and in the reference symbol information 1101132, a pointer to the symbol entry of “lab” is stored.
Return to 01.

【0028】次に構文処理801で「mov A,X」
という構文が入力されたことを解析する。次に意味解析
処理802では「mov A,X」の構文の意味を解析
し、オブジェクトコード「0001」を出力すればよい
という解析を行なう。次にオブジェクトコード決定判定
処理803でオブジェクトコードが決定できるかどうか
を判定する。中間言語データ作成処理803で中間言語
の作成を行なう。この場合でオブジェクトコードは決定
であるので決定中間言語データ作成処理804を行な
う。決定中間言語データ作成処理804ではインストラ
クション識別子1101121として未決定の情報を出
力し、そのあと決定のオブジェクトコード110122
を出力し、構文処理01に戻る。次に構文処理801で
「end」という構文が入力されたことを解析する。次
に意味解析処理02では「end」の構文の意味を解析
し、構文解析を終了する。
Next, in syntax processing 801, “mov A, X”
It analyzes that the syntax was input. Next, in the semantic analysis processing 802, the meaning of the syntax of “mov A, X” is analyzed, and analysis is performed to output the object code “0001”. Next, it is determined whether or not an object code can be determined in an object code determination determination process 803. In the intermediate language data creation processing 803, an intermediate language is created. In this case, since the object code is determined, the determined intermediate language data creation processing 804 is performed. In the determined intermediate language data creation processing 804, information that has not been determined is output as the instruction identifier 1101121, and then the determined object code 110122 is output.
And returns to the syntax processing 01. Next, in the syntax processing 801, it is analyzed that the syntax “end” is input. Next, in the semantic analysis process 02, the meaning of the syntax of “end” is analyzed, and the syntax analysis ends.

【0029】次に、中間データ解析部610の動作を説
明する。
Next, the operation of the intermediate data analyzer 610 will be described.

【0030】まず識別値判定処理901で中間データの
インストラクション識別値110112の判定を行い、
未決定であるのでオブジェクト決定処理902を行な
う。オブジェクト決定処理902では参照シンボル情報
が指しているシンボルエントリ「lab」の値2を参照
位置情報に入っているオブジェクトコード110112
の参照位置に出力してオブジェクトコード110112
の決定を行なう。オブジェクトコード110112は
「1000」から「1002」に更新される。オブジェ
クト出力処理903を行なう。オブジェクト出力処理9
03ではデータエントリ中のオブジェクトコード「10
02」の出力を行ない、終了判定処理904を行なう。
終了判定所為904ではデータエントリがまだあるか否
かの判定を行ない、データエントリがまだあれば識別値
判定処理901に戻る。
First, in an identification value determination process 901, the instruction identification value 110112 of the intermediate data is determined.
Since it has not been determined, the object determination processing 902 is performed. In the object determination process 902, the value 2 of the symbol entry “lab” pointed to by the reference symbol information is set to the object code 110112 included in the reference position information.
To the reference position of the object code 110112
Make a decision. The object code 110112 is updated from “1000” to “1002”. An object output process 903 is performed. Object output processing 9
03, the object code “10” in the data entry
02 ", and an end determination process 904 is performed.
In the end determination reason 904, it is determined whether or not a data entry still exists. If there is a data entry, the process returns to the identification value determination processing 901.

【0031】次に識別値判定処理901で中間データの
インストラクション識別値110112の判定を行な
い、決定であるのでオブジェクト出力処理903を行な
う。オブジェクト出力処理903ではデータエントリ中
のオブジェクトコード「0001」の出力を行ない、終
了判定処理904を行なう。終了判定処理904ではデ
ータエントリがまだあるか否かの判定を行ない、中間デ
ータ解析を終了する。
Next, in the identification value determination processing 901, the instruction identification value 110112 of the intermediate data is determined, and since it is determined, the object output processing 903 is performed. In the object output process 903, the object code "0001" in the data entry is output, and the end determination process 904 is performed. In the end determination processing 904, it is determined whether or not there is a data entry, and the intermediate data analysis ends.

【0032】[0032]

【発明が解決しようとする課題】最適化処理によってシ
ンボルの定義位置と参照位置がずれるために1回目の構
文解析でシンボルの参照は決定できない。そのため、上
述した従来の最適化処理のように、中間言語を用いた方
法となるが、中間言語によって表されている中間データ
は生成されるオブジェクトコードより大きく複雑な形と
なっており、解析時には一行ごとに解析をしなければな
らないため、中間言語の生成とその解析に処理時間が多
くかかってしまう問題点があった。
The symbol reference cannot be determined by the first syntax analysis because the definition position and the reference position of the symbol are shifted by the optimization process. Therefore, as in the above-described conventional optimization processing, a method using an intermediate language is used, but the intermediate data represented by the intermediate language is larger and more complex than the generated object code. Since the analysis must be performed line by line, there is a problem that it takes a lot of processing time to generate and analyze the intermediate language.

【0033】[0033]

【課題を解決するための手段】本発明のアセンブラ処理
方法は、入力データを読み込む工程と、所定の構文がシ
ンボルテーブルを参照するごとに参照情報を生成し最適
化命令ごとに最適化情報テーブルを生成し前記構文が最
適化疑似命令のときブロック情報を生成し前記入力デー
タから中間コードを作成する構文解析工程と、前記シン
ボルテーブルおよび前記最適化情報テーブルのそれぞれ
に対応して前記最適化命令のステップ数を最適化する最
適化処理工程と、前記中間コード中の未決定オペランド
の解決を前記ブロック情報が指している前記中間コード
の位置から前記ブロック情報が持っているサイズ分だけ
行うコード生成処理工程と、前記コード生成処理工程で
生成生成されたオブジェクトコードを出力するオブジェ
クトファイル出力工程とを有する構成である。
According to the assembler processing method of the present invention, input data is read , reference information is generated each time a predetermined syntax refers to a symbol table, and an optimization information table is generated for each optimization instruction. Generated and the syntax
A syntax analysis step of generating block information at the time of an optimization pseudo instruction and creating an intermediate code from the input data, and optimizing the number of steps of the optimization instruction corresponding to each of the symbol table and the optimization information table Optimization processing step, and the intermediate code pointed to by the block information to resolve an undecided operand in the intermediate code
A code generation processing step of performing only the size of the block information from the position of
Object that outputs generated object code
And a task file output step .

【0034】また、本発明のアセンブラ処理方法の前記
構文解析工程は、前記構文がインストラクションのとき
中間コードの生成を行う構文処理ステップと、前記構文
前記最適化疑似命令か否かを判定する最適化疑似命令
判定処理ステップと、前記最適化疑似命令判定処理ステ
ップで前記構文が前記最適化疑似命令のとき実行する分
岐情報生成処理ステップと、前記構文がセグメント疑似
命令否かを判定するセグメント疑似命令判定処理ステ
ップと、前記セグメント疑似命令判定処理ステップで前
記構文がセグメント疑似命令のとき実行するブロック情
報生成処理ステップと、前記構文の前記オペランドに未
定義参照シンボルがあるか否かを判定する未定義参照判
定ステップと、前記構文の前記オペランドに未定義参照
シンボルがあるとき実行する参照情報処理ステップとを
有する構成とすることもできる。
Further, the syntax analysis step of the assembler processing method of the present invention includes a syntax processing step of generating an intermediate code when the syntax is an instruction, and an optimization processing for determining whether the syntax is the optimization pseudo instruction. of directive and determination process step, the optimization directive decision processing branch information generation processing step of executing time of the syntax the optimized pseudo-instruction in step the syntax segment determines segment directive or pseudo An instruction determination processing step, a block information generation processing step to be executed when the syntax is a segment pseudo instruction in the segment pseudo instruction determination processing step, and a determination whether an undefined reference symbol exists in the operand of the syntax. A definition reference determining step, and when there is an undefined reference symbol in the operand of the syntax It may be configured to have a reference information processing step of executing.

【0035】[0035]

【実施例】図1は本発明の第1の実施例アセンブラの処
理方法のシステムブロック図である。
FIG. 1 is a system block diagram of a processing method of an assembler according to a first embodiment of the present invention.

【0036】図1を参照すると、本実施例のアセンブラ
の処理方法は、入力ファイルとなるソースファイル10
1とアセンブラの処理を行うアセンブラ102、出力フ
ァイルとなるオブジェクトファイル103とから構成さ
れている。
Referring to FIG. 1, a processing method of the assembler according to the present embodiment uses a source file 10 as an input file.
1 and an assembler 102 that performs assembler processing, and an object file 103 that is an output file.

【0037】アセンブラ102では、まずソースファイ
ル入力部104がソースファイル101を読み込む。次
に構文解析部105で読み込んだ内容を構文解析し、シ
ンボルテーブル106、最適化情報テーブル107、ブ
ロック情報テーブル108および参照情報テーブル10
9のそれぞれを作成し、解析した内容で中間コード11
0を作成する。構文解析部105中の最適化情報生成部
1051によって構文が最適化疑似命令であった時に最
適化情報テーブル107に最適化情報エントリを作成
し、構文解析部105中のブロック処理1052によっ
て、構文がブロックの始まりである際にブロック情報テ
ーブル108を作成する。
In the assembler 102, first, the source file input section 104 reads the source file 101. Next, the content read by the syntax analysis unit 105 is parsed, and the symbol table 106, the optimization information table 107, the block information table 108, and the reference information table 10 are analyzed.
9 are created, and the intermediate code 11 is
Create 0. When the syntax is an optimization pseudo-instruction by the optimization information generation unit 1051 in the syntax analysis unit 105, an optimization information entry is created in the optimization information table 107, and the syntax is changed by the block processing 1052 in the syntax analysis unit 105. A block information table 108 is created at the beginning of a block.

【0038】上述のブロックとはソースプログラムを最
適化疑似命令で分けた個々の部分のことであり、例え
ば、図2に示すアセンブラソースはn個の最適化疑似命
令からなり、(n+1)個のブロック1201〜120
(n+1)に分けられる。ただし、「lab:」はラベ
ル定義、「br lab」は最適化疑似命令、「no
p」は機械語命令、「end」はアセンブラの終了をあ
らわす疑似命令である。
The above-mentioned blocks are individual parts obtained by dividing a source program by optimization pseudo-instructions. For example, the assembler source shown in FIG. 2 includes n optimization pseudo-instructions and (n + 1) pieces of optimization pseudo-instructions. Blocks 1201 to 120
(N + 1). However, “lab:” is a label definition, “br lab” is an optimization pseudo instruction, and “no
"p" is a machine language instruction, and "end" is a pseudo-instruction indicating the end of the assembler.

【0039】シンボルテーブル106はシンボル定義が
あった際に作成されるシンボル情報のテーブルであり、
最適化情報テーブル107は最適化疑似命令があった際
に作成される最適化情報のテーブルであり、ブロック情
報テーブル108はブロックの始まりごとに作成される
ブロック情報のテーブルであり、参照情報テーブル10
9は前方参照があった際に作成される参照情報のテーブ
ルであり、中間コード110はソースプログラムを機械
語コードに変換したコードである。構文解析終了後、最
適化処理部111でシンボルテーブル106と最適化情
報テーブル107を用いて最適化処理を行ない、シンボ
ルテーブル106を更新する。最適化処理111終了
後、コード生成処理部112でシンボルテーブル10
6、最適化情報テーブル107、ブロック情報テーブル
108および参照情報テーブル109のそれぞれを使っ
て最適化疑似命令の解決と、前方参照によって未決定で
あった中間コード110のオペランドの解決をしてオブ
ジェクトコードを作成し、オブジェクトコードをオブジ
ェクトファイル出力部113で出力する。
The symbol table 106 is a table of symbol information created when a symbol is defined.
The optimization information table 107 is a table of optimization information created when there is an optimization pseudo instruction. The block information table 108 is a table of block information created at the beginning of each block.
Reference numeral 9 denotes a table of reference information created when a forward reference is made, and the intermediate code 110 is a code obtained by converting a source program into a machine language code. After the syntax analysis, the optimization processing unit 111 performs optimization processing using the symbol table 106 and the optimization information table 107, and updates the symbol table 106. After the optimization processing 111 is completed, the code generation processing unit 112 causes the symbol table 10
6. The optimization pseudo-instruction is resolved using each of the optimization information table 107, the block information table 108, and the reference information table 109, and the operand of the intermediate code 110 that has not been determined by forward reference is resolved into an object code. Is created, and the object code is output by the object file output unit 113.

【0040】シンボルテーブル106、最適化情報テー
ブル107、ブロック情報テーブル108、参照情報テ
ーブル109および中間コード110のそれぞれの詳細
を図3を参照して説明する。
The details of each of the symbol table 106, the optimization information table 107, the block information table 108, the reference information table 109, and the intermediate code 110 will be described with reference to FIG.

【0041】まず、n個のシンボル定義とm個の最適化
疑似命令とk個のシンボル参照が入力されたアセンブラ
ソース中に記述されている時、シンボルテーブル130
1にはn個のシンボルエントリ(13011〜1301
n)が作成され、最適化情報テーブル1302にはm個
の最適化情報エントリ(13021〜1302m)が作
成され、ブロック情報テーブル1303には(m+1)
個のブロック情報エントリ(13031〜1303(m
+1))が作成され、参照情報テーブル1304にはk
個の参照情報エントリ(13041〜1304k)が作
成される。
First, when n symbol definitions, m optimization pseudo-instructions, and k symbol references are described in the input assembler source, the symbol table 130
1 has n symbol entries (13011 to 1301)
n) is created, m optimization information entries (13021 to 1302m) are created in the optimization information table 1302, and (m + 1) is created in the block information table 1303.
Block information entries (13031 to 1303 (m
+1)) is created, and k is added to the reference information table 1304.
Pieces of reference information entries (13041 to 1304k) are created.

【0042】シンボルエントリ(13011〜1301
n)は、定義されたシンボルに関する情報を持つエント
リでありシンボルが定義されたアドレス値を持つ。最適
化情報エントリ(13021〜1302m)は、最適化
に必要とされる情報をもつエントリでありその最適化疑
似命令がどの命令に置き換えられたかの情報を持つ。ブ
ロック情報エントリ(13031〜1303(m+
1))は、ブロックに関する情報をもつエントリであり
そのブロック中の参照情報の数とそのブロックの先頭に
記述された前方参照によって生成された参照情報エント
リへのポインタとそのブロックの先頭に記述された最適
化疑似命令によって生成された最適化情報エントリへの
ポインタとのそのブロックの先頭の中間コード1305
へのポインタとそのブロックの中間コード1305のサ
イズを持つ。ただし、そのブロックがセグメントの先頭
のときは最適化情報エントリへのポインタはNULLを
持つ。参照情報エントリ(13041〜1304k)
は、シンボル参照を解決するためのエントリであり参照
しているシンボルエントリへのポインタと中間コード1
305中のシンボル参照が行なわれている位置へのポイ
ンタを持つ。
Symbol entries (13011 to 1301)
n) is an entry having information on the defined symbol, and has an address value at which the symbol is defined. The optimization information entries (13021 to 1302m) are entries having information required for optimization, and have information on which instruction the optimization pseudo instruction has been replaced with. Block information entry (13031 to 1303 (m +
1)) is an entry having information on a block, the number of reference information in the block, a pointer to a reference information entry generated by a forward reference described at the head of the block, and a description at the head of the block. The pointer to the optimization information entry generated by the optimized optimization pseudo instruction and the intermediate code 1305 at the beginning of the block
And the size of the intermediate code 1305 of the block. However, when the block is the head of the segment, the pointer to the optimization information entry has NULL. Reference information entry (13041 to 1304k)
Is an entry for resolving a symbol reference, and a pointer to the referring symbol entry and an intermediate code 1
It has a pointer to a position in 305 where a symbol reference is made.

【0043】次に、構文解析部105の構文解析工程の
フローチャートを図4に示す。
Next, FIG. 4 shows a flowchart of the syntax analysis process of the syntax analysis unit 105.

【0044】まず構文処理1401で構文の解析が行な
われる。解析した構文がインストラクションであれば中
間コードの生成を行ない、次に最適化疑似命令判定処理
1402を行なう。構文が最適化疑似命令であれば分岐
情報生成処理1403を行ない、そうでなければセグメ
ント疑似命令判定処理1404を行なう。
First, syntax analysis is performed in syntax processing 1401. If the analyzed syntax is an instruction, an intermediate code is generated, and then an optimization pseudo instruction determination process 1402 is performed. If the syntax is an optimization pseudo instruction, branch information generation processing 1403 is performed; otherwise, segment pseudo instruction determination processing 1404 is performed.

【0045】分岐情報生成処理1403では最適化情報
テーブル107に最適化情報エントリの生成を行ない、
次にブロック情報生成処理1405を行なう。セグメン
ト疑似命令判定処理1404では構文がセグメント疑似
命令であればブロック情報生成処理1405を行ない、
そうでなければ未定定義参照判定処理1406を行な
う。ブロック情報生成処理1405ではブロック情報テ
ーブル108にブロック情報エントリの生成を行ない、
次に未定義参照判定処理1406を行なう。参照情報生
成処理1407では参照情報テーブル109に参照情報
エントリの生成を行ない、次に終了判定処理1408を
行なう。終了判定処理1408では構文がまだあるか否
かの判定を行ない、構文がまだあれば構文処理1401
に戻り、そうでなければ構文解析を終了する。最適化処
理部111は分岐疑似情報を用いて最適化を行ない、シ
ンボルテーブル106のシンボルのアドレスを最適なも
のに決定する。
In the branch information generation processing 1403, an optimization information entry is generated in the optimization information table 107.
Next, block information generation processing 1405 is performed. In the segment pseudo instruction determination processing 1404, if the syntax is a segment pseudo instruction, block information generation processing 1405 is performed.
Otherwise, an undefined definition reference determination process 1406 is performed. In block information generation processing 1405, a block information entry is generated in the block information table 108, and
Next, an undefined reference determination process 1406 is performed. In the reference information generation processing 1407, a reference information entry is generated in the reference information table 109, and then an end determination processing 1408 is performed. In the end determination processing 1408, it is determined whether or not the syntax still exists.
Return to, otherwise terminate the parsing. The optimization processing unit 111 performs optimization using the branch pseudo information, and determines the address of the symbol in the symbol table 106 to be the optimum.

【0046】次に、コード生成処理部112のフローチ
ャートを示す図5を参照すると、コード生成処理部11
2はブロック情報テーブル108中のブロック情報エン
トリを先頭から一つずつ処理を行なう。まずコード生成
終了判定処理1501を行なう。コード生成終了判定処
理1501ではブロック情報参照位置にブロック情報エ
ントリがまだあるか否かの判定し、まだあれば参照情報
参照位置設定処理1502を行ない、そうでなければコ
ード生成処理112を終了する。参照情報参照位置設定
処理1502では参照情報の参照位置に参照しているブ
ロック情報が持つ参照情報エントリへのポインタを設定
し、参照情報の残数に参照しているブロック情報が持つ
ブロック中の参照情報の数を設定し、参照情報終了判定
処理1503を行なう。参照情報終了判定処理1503
では参照情報エントリがまだあるか否かの判定し、参照
情報の残数が0なら、最適化情報判定処理1506を行
ない、そうでないなら、参照情報処理1504を行な
う。
Next, referring to FIG. 5 showing a flowchart of the code generation processing section 112,
2 processes the block information entries in the block information table 108 one by one from the top. First, code generation end determination processing 1501 is performed. In the code generation end determination processing 1501, it is determined whether or not there is a block information entry at the block information reference position. If so, the reference information reference position setting processing 1502 is performed. Otherwise, the code generation processing 112 is ended. In the reference information reference position setting processing 1502, a pointer to the reference information entry of the referenced block information is set at the reference position of the reference information, and the reference in the block of the block information referenced by the remaining number of reference information is set. The number of pieces of information is set, and reference information end determination processing 1503 is performed. Reference information end determination processing 1503
Then, it is determined whether or not there is still a reference information entry. If the remaining number of reference information is 0, optimization information determination processing 1506 is performed. Otherwise, reference information processing 1504 is performed.

【0047】参照情報処理1504では現在参照中の参
照情報が指しているシンボルからアドレス値を取りだ
し、そのアドレス値を参照情報が指している中間コード
の位置へ埋め込んでアドレスの解決を行ない、参照情報
参照位置変更処理1505を行なう。参照情報参照位置
変更処理1505では参照情報参照位置を次の参照情報
エントリの位置に変更し、参照情報の残数を1つ減ら
し、参照情報判定処理1503へ戻る。最適化情報判定
処理1506では参照しているブロック情報が最適化情
報エントリへのポインタがNULLでないなら、最適化
情報処理1507を行ない、NULLなら、コード出力
処理1508を行なう。
The reference information processing 1504 extracts an address value from the symbol pointed to by the reference information currently being referenced, embeds the address value at the position of the intermediate code pointed to by the reference information, and resolves the address. Reference position change processing 1505 is performed. In the reference information reference position change processing 1505, the reference information reference position is changed to the position of the next reference information entry, the remaining number of reference information is reduced by one, and the process returns to the reference information determination processing 1503. In the optimization information determination processing 1506, if the pointer to the optimization information entry of the block information referred to is not NULL, the optimization information processing 1507 is performed. If the pointer is NULL, the code output processing 1508 is performed.

【0048】最適化情報処理1507では参照している
ブロック情報が指している最適化情報エントリが置き換
えられる命令をオブジェクトコードとして出力し、コー
ド出力処理1508を行なう。コード出力処理1508
では参照しているブロック情報が指している中間コード
の位置から中間コードを参照しているブロック情報が持
っている中間コードのサイズだけオブジェクトコードと
して出力し、コード生成終了判定処理1501に戻る。
具体的な例として図6に示すアセンブラソースが入力さ
れたときの動作を説明する。
The optimization information processing 1507 outputs, as an object code, an instruction to replace the optimization information entry pointed to by the referred block information, and performs a code output process 1508. Code output processing 1508
Then, from the position of the intermediate code pointed to by the referring block information, only the size of the intermediate code held by the block information referencing the intermediate code is output as the object code, and the process returns to the code generation end determination processing 1501.
The operation when the assembler source shown in FIG. 6 is input will be described as a specific example.

【0049】図6には3行からなるアセンブラソースで
「lab:」はラベル定義命令であり、「mov A,
lab」はオブジェクトコード「10XX」であり、
「brlab」最適化疑似命令であり、短いコードの分
岐命令に置き換えられる時オブジェクトコード「01X
X」であるとする。「end」はend疑似命令で構文
の終りであることを示す疑似命令とする。ただしXXに
はlabの相対アドレスが入るとする。
FIG. 6 shows a three-line assembler source in which "lab:" is a label definition instruction and "mov A,
"lab" is the object code "10XX",
A "brlab" optimization pseudo-instruction, which is replaced with a short-code branch instruction when the object code "01X
X ". "End" is an end pseudo instruction which indicates the end of the syntax. However, it is assumed that XX contains the relative address of lab.

【0050】最適化処理111が終了した後のシンボル
テーブル106、最適化情報テーブル107、ブロック
情報テーブル108、参照情報テーブル109および中
間コード110をのそれぞれを図7に示す。
FIG. 7 shows the symbol table 106, the optimization information table 107, the block information table 108, the reference information table 109, and the intermediate code 110 after the optimization processing 111 has been completed.

【0051】シンボルテーブル1701はシンボルエン
トリ17011を持ち、シンボルエントリ17011は
ラベルが定義されたアドレス値2を持つ。最適化情報テ
ーブル1702は最適化情報エントリ17021を持
ち、最適化情報エントリ17021の最適化疑似命令が
短いコードの分岐命令に置き換えられるという情報を持
つ。ブロック情報テーブル1703はブロック情報エン
トリ17031とブロック情報エントリ17032を持
つ。ブロック情報エントリ17031は参照情報の数1
と参照情報エントリ17041へのポインタと中間コー
ドのサイズ2を持つ。ブロック情報エントリ17032
は参照情報の数0と最適化情報エントリ17021への
ポインタと中間コードのサイズ0を持つ。参照情報テー
ブル1704は参照情報エントリ17041を持ち、参
照情報エントリ17041は参照しているシンボルエン
トリ17011へのポインタと中間コード1710の2
バイト目を指す。
The symbol table 1701 has a symbol entry 17011, and the symbol entry 17011 has an address value 2 in which a label is defined. The optimization information table 1702 has an optimization information entry 17021, and has information that the optimization pseudo-instruction of the optimization information entry 17021 is replaced by a short code branch instruction. The block information table 1703 has a block information entry 17031 and a block information entry 17032. The block information entry 17031 is the number of reference information 1
And a pointer to the reference information entry 17041 and the size 2 of the intermediate code. Block information entry 17032
Has a reference information number 0, a pointer to the optimization information entry 17021, and an intermediate code size 0. The reference information table 1704 has a reference information entry 17041, and the reference information entry 17041 stores a pointer to the symbol entry 17011 being referred to and two of the intermediate code 1710.
Points to the byte.

【0052】つぎにコード生成処理部112の動作を説
明する。まずコード生成終了判定処理1501を行な
う。コード生成終了判定処理1501ではブロック情報
参照位置にブロック情報がまだあるか否かの判定し、参
照情報参照位置設定処理1502を行なう。参照情報参
照位置設定処理1502では参照情報の参照位置に参照
しているブロック情報17021が持つ、参照情報エン
トリ17041へのポインタを設定し、参照情報の残数
に参照しているブロック情報が持つ、ブロック中の参照
情報の数1を設定し、参照情報終了判定処理1503を
行なう。
Next, the operation of the code generation processing unit 112 will be described. First, code generation end determination processing 1501 is performed. In the code generation end determination processing 1501, it is determined whether or not there is still block information at the block information reference position, and reference information reference position setting processing 1502 is performed. In the reference information reference position setting processing 1502, a pointer to the reference information entry 17041 of the block information 17021 referred to in the reference position of the reference information is set, and the block information referred to in the remaining number of reference information has The reference information number 1 in the block is set, and reference information end determination processing 1503 is performed.

【0053】参照情報終了判定処理1503では参照情
報エントリがまだあるか否かの判定し、参照情報処理1
504を行なう。参照情報処理1504では参照情報エ
ントリ17031が指しているシンボルエントリ170
11からアドレス値0を取りだし、そのアドレス値を参
照情報が指している中間コードの位置へ埋め込んで参照
の解決を行ない、参照情報参照位置変更処理1505を
行なう。参照情報参照位置変更処理1505では参照情
報の残数を1つ減らして0とし、参照情報終了判定処理
1503へ戻る。参照情報終了判定処理1503では参
照情報エントリがまだあるか否かの判定し、最適化情報
判定処理1506を行なう。
In reference information end determination processing 1503, it is determined whether or not there is still a reference information entry.
Perform 504. In the reference information processing 1504, the symbol entry 170 indicated by the reference information entry 17031
The address value 0 is extracted from the address 11, the address value is embedded in the position of the intermediate code pointed to by the reference information, the reference is resolved, and the reference information reference position change processing 1505 is performed. In the reference information reference position change processing 1505, the remaining number of reference information is reduced by one to 0, and the process returns to the reference information end determination processing 1503. In reference information end determination processing 1503, it is determined whether or not there is a reference information entry, and optimization information determination processing 1506 is performed.

【0054】最適化情報判定処理1506では参照して
いるブロック情報が最適化情報エントリへのポインタが
NULLが否か判定し、ここではNULLなので最適化
情報処理1507を行ない、コード出力処理1508を
行なう。コード出力処理1508では参照しているブロ
ック情報が指している中間コードの位置から中間コード
を、参照しているブロック情報が持っている中間コード
のサイズ2バイトだけオブジェクトコードとして出力
し、コード生成終了判定処理1501に戻る。コード生
成終了判定処理1501ではブロック情報参照位置にブ
ロック情報がまだあるか否かの判定し、参照情報参照位
置設定処理1502を行なう。
In the optimization information determination processing 1506, it is determined whether or not the pointer to the optimization information entry of the block information referred to is NULL, and here, since the pointer is NULL, the optimization information processing 1507 is performed and the code output processing 1508 is performed. . In the code output processing 1508, an intermediate code is output from the position of the intermediate code pointed to by the referenced block information as an object code with a size of 2 bytes of the intermediate code held by the referenced block information, and the code generation ends. The process returns to the determination processing 1501. In the code generation end determination processing 1501, it is determined whether or not there is still block information at the block information reference position, and reference information reference position setting processing 1502 is performed.

【0055】参照情報参照位置設定1502では参照情
報の参照位置に参照している参照情報の残数に参照して
いるブロック情報エントリ17032が持つ、ブロック
中の参照情報の数0を設定し、参照情報終了判定処理1
503を行なう。参照情報終了判定処理1503では参
照情報エントリがまだあるか否かの判定し、参照情報処
理判定処理1506を行なう。最適化情報判定処理15
06では参照しているブロック情報が最適化情報エント
リへのポインタを持っている否かを判定し、最適化情報
処理1507を行なう。最適化情報処理1507では参
照しているブロック情報エントリ17032が指してい
る最適化情報エントリ17021が置き換えられる命令
をオブジェクトコードとして出力し、コード出力処理1
508を行なう。コード出力処理1508では参照して
いるブロック情報が指している中間コードの位置から中
間コードを、参照しているブロック情報が持っている中
間コードのサイズだけオブジェクトコードとして出力す
るが、ブロック情報18032が持っている中間コード
のサイズは0バイトであるため、コード生成終了判定処
理1501に戻る。コード生成終了判定処理1501で
はブロック情報参照位置にブロック情報エントリがまだ
あるか否かの判定し、コード生成処理112を終了す
る。
In the reference information reference position setting 1502, the number 0 of reference information in the block of the block information entry 17032 which is referred to the remaining number of reference information referred to the reference position of the reference information is set, and the reference is set. Information end determination processing 1
Perform 503. In reference information end determination processing 1503, it is determined whether or not there is a reference information entry, and reference information processing determination processing 1506 is performed. Optimization information determination processing 15
At 06, it is determined whether or not the referenced block information has a pointer to the optimization information entry, and the optimization information processing 1507 is performed. The optimization information processing 1507 outputs, as an object code, an instruction to replace the optimization information entry 17021 pointed to by the referred block information entry 17032, and outputs the code.
Perform 508. In the code output process 1508, the intermediate code is output as an object code from the position of the intermediate code pointed to by the referenced block information by the size of the intermediate code held by the referenced block information. Since the size of the intermediate code is 0 bytes, the process returns to the code generation end determination processing 1501. In the code generation end determination processing 1501, it is determined whether or not there is still a block information entry at the block information reference position, and the code generation processing 112 ends.

【0056】次に、本発明の第2の実施例のアセンブラ
の処理方法について説明する。
Next, an assembler processing method according to the second embodiment of the present invention will be described.

【0057】図8を参照すると、本実施例のアセンブラ
処理方法は、入力ファイルとなるソースファイル180
1とアセンブルの処理を行なうアセンブラ1802と、
出力ファイルとなるオブジェクトファイル1803とか
ら構成されている。
Referring to FIG. 8, the assembler processing method of the present embodiment employs a source file 180 as an input file.
1 and an assembler 1802 that performs assembling processing;
An object file 1803 serving as an output file is provided.

【0058】アセンブラ1802では、まずソースファ
イル入力部1804がソースファイル1801を読み込
む。次に構文解析部1805で読み込んだ内容を構文解
析し、シンボルテーブル1806、最適化情報テーブル
1807および参照情報テーブル1808のそれぞれを
作成し、解析した内容で中間コード1809を作成す
る。構文析部1805中の最適化情報生成部18051
によって構文化最適疑似命令であった時に最適化情報テ
ーブル1807に最適化情報エントリを作成する。
In the assembler 1802, the source file input unit 1804 reads the source file 1801 first. Next, the content read by the syntax analysis unit 1805 is analyzed, and a symbol table 1806, an optimization information table 1807, and a reference information table 1808 are created, and an intermediate code 1809 is created based on the analyzed content. Optimization information generating section 18051 in parsing section 1805
When the instruction is a syntax optimization instruction, an optimization information entry is created in the optimization information table 1807.

【0059】構文解析終了後、最適化処理部1810で
シンボルテーブル1806と最適化情報テーブル180
7を用いて最適化処理を行ない、シンボルテーブル18
06を更新する。最適化処理終了後、コード生成処理部
1811でシンボルテーブル1806、最適化情報テー
ブル1807および参照情報テーブル1808をのそれ
ぞれ使って、最適化疑似命令の解決をしてオブジェクト
コードを作成し、オブジェクトコードをオブジェクトフ
ァイル出力部1812で出力する。
After the completion of the syntax analysis, the optimization processing unit 1810 performs a symbol table 1806 and an optimization information table 180
7 is optimized using the symbol table 18
06 is updated. After the optimization process is completed, the code generation processing unit 1811 solves the optimization pseudo instruction using each of the symbol table 1806, the optimization information table 1807, and the reference information table 1808 to create an object code. The data is output by the object file output unit 1812.

【0060】シンボルテーブル1806、最適化情報テ
ーブル1807、参照情報テーブル1808および中間
コード1809のそれぞれの詳細を図9に示す。
FIG. 9 shows details of the symbol table 1806, the optimization information table 1807, the reference information table 1808, and the intermediate code 1809.

【0061】n個のシンボル定義とm個の最適化疑似命
令とk個のシンボル参照が入力されたアセンブラソース
中に記述されている時、シンボルテーブル1901には
n個のシンボルエントリ(19011〜1901n)が
作成され、最適化情報テーブル1902にはm個の最適
化情報エントリ(19021〜1902m)が作成さ
れ、参照情報テーブル1903にはk個の参照情報エン
トリ(19031〜1903k)が作成される。
When n symbol definitions, m optimization pseudo-instructions, and k symbol references are described in the input assembler source, the symbol table 1901 has n symbol entries (19011-1901n). ) Is created, m optimization information entries (19021 to 1902m) are created in the optimization information table 1902, and k reference information entries (19031 to 1903k) are created in the reference information table 1903.

【0062】シンボルエントリ(19011〜1901
n)は、定義されたシンボルに関する情報を持つエント
リでありシンボルが定義されたアドレス値を持つ。最適
化情報エントリ(19021〜1902m)は、最適化
に必要とされる情報をもつエントリでありその最適化疑
似命令がどの命令に置き換えられたかの情報とその最適
化命令によって生成された参照情報へのポインタを持
つ。参照情報エントリ(19031〜1903k)は、
シンボル参照を解決するためのエントリであり参照種別
と参照しているシンボルエントリへのポインタと中間コ
ード1904中のシンボル参照が行なわれている位置へ
のポインタを持つ。参照種別とはその参照が最適化疑似
命令によるエントリであるものについてはその最適化疑
似命令がどの命令で生成されるかの識別子かあるいはそ
の参照が最適化疑似命令によるエントリではないという
識別値が入る。
The symbol entry (19011-1901)
n) is an entry having information on the defined symbol, and has an address value at which the symbol is defined. The optimization information entries (19021 to 1902m) are entries having information necessary for optimization, and include information on which instruction the optimization pseudo instruction has been replaced with and reference information generated by the optimization instruction. Have a pointer. The reference information entry (19031 to 1903k)
This is an entry for resolving a symbol reference, and has a reference type, a pointer to the symbol entry being referred to, and a pointer to a position in the intermediate code 1904 where the symbol reference is performed. A reference type is an identifier of an instruction generated by an optimization pseudo instruction for an entry whose reference is an optimization pseudo instruction, or an identification value indicating that the reference is not an entry by an optimization pseudo instruction. enter.

【0063】構文解析部1805の構文解析工程のフロ
ーチャートを図10に示す。
FIG. 10 shows a flowchart of the syntax analysis process of the syntax analysis unit 1805.

【0064】図10を参照すると、構文処理2001で
構文の解析が行なわれる。解析した構文がインストラク
ションであれば中間コードの生成を行ない、次に未定義
参照判定処理2002を行なう。未定義参照判定処理2
002ではオペランドに未定義参照シンボルがあるな
ら、最適化疑似命令判定処理2003を行な、そうでな
ければ終了判定処理2006を行なう。次に最適化疑似
命令判定処理2003を行なう。構文が最適化疑似命令
であれば最適化情報生成処理2004を行ない、そうで
なければ参照情報生成処理2005を行なう。最適化情
報生成処理2004では最適化情報テーブル1807に
最適化情報エントリの生成を行ない、参照情報生成処理
2005を行なう。参照情報生成処理2007では参照
情報テーブル1808に参照情報エントリの生成を行な
い、次に終了判定処理2008を行なう。終了判定処理
2008では構文がまだあるか否かの判定を行ない、構
文がまだあれば構文処理2001に戻り、そうでなけれ
ば構文解析を終了する。最適化処理部1810は分岐疑
似情報を用いて最適化を行ない、シンボルテーブル18
06のシンボルのアドレスを最適化なものに決定し、参
照情報テーブル1807の参照情報エントリの参照種別
を決定する。
Referring to FIG. 10, syntax analysis is performed in syntax processing 2001. If the analyzed syntax is an instruction, an intermediate code is generated, and then an undefined reference determination process 2002 is performed. Undefined reference determination processing 2
In 002, if there is an undefined reference symbol in the operand, an optimization pseudo-instruction determination process 2003 is performed; otherwise, an end determination process 2006 is performed. Next, an optimization pseudo instruction determination process 2003 is performed. If the syntax is an optimization pseudo instruction, an optimization information generation process 2004 is performed; otherwise, a reference information generation process 2005 is performed. In the optimization information generation process 2004, an optimization information entry is generated in the optimization information table 1807, and the reference information generation process 2005 is performed. In the reference information generation processing 2007, a reference information entry is generated in the reference information table 1808, and then the end determination processing 2008 is performed. In the end determination process 2008, it is determined whether or not there is a syntax. If there is a syntax, the process returns to the syntax process 2001; otherwise, the syntax analysis ends. The optimization processing unit 1810 performs optimization using the branch pseudo information, and
The address of the symbol 06 is determined to be optimized, and the reference type of the reference information entry in the reference information table 1807 is determined.

【0065】コード生成処理部1811のコード生成処
理工程のフローチャートを示す図11を参照すると、コ
ード生成処理部1811は参照情報テーブル1808中
の参照情報エントリを先頭から一つずつ処理を行なう。
まずコード生成終了判定処理2101を行なう。コード
生成終了判定処理2101では参照情報エントリがまだ
あるか否かの判定し、まだあれば参照種別判定処理21
02を行ない、そうでなければ終了処理2106を終了
する。参照種別判定処理2102では参照中の参照情報
中の参照種別にその参照が最適化疑似命令によるエント
リではない識別値が入っているのなら、参照解決処理2
103を行ない、そうでないなら、オブジェクト出力処
理2104を行なう。参照決処理2103では参照情報
が指しているシンボルからアドレス値を取りだし、その
アドレス値を参照情報が指してる中間コードの位置へ埋
め込んでアドレスの解決を行ない、コード生成終了判定
処理2101に戻る。
Referring to FIG. 11 which shows a flowchart of the code generation processing step of the code generation processing section 1811, the code generation processing section 1811 processes reference information entries in the reference information table 1808 one by one from the top.
First, code generation end determination processing 2101 is performed. In the code generation end determination process 2101, it is determined whether or not there is a reference information entry.
02, otherwise terminate the end process 2106. In the reference type determination process 2102, if the reference type in the reference information being referred to includes an identification value whose reference is not an entry by an optimization pseudo instruction, the reference resolution process 2102
103 is performed, and if not, an object output process 2104 is performed. In the reference decision processing 2103, an address value is extracted from the symbol indicated by the reference information, the address value is embedded in the position of the intermediate code indicated by the reference information, the address is resolved, and the process returns to the code generation end determination processing 2101.

【0066】オブジェクト出力処理2104では参照中
の参照情報が指してる中間コード1904中のシンボル
参照が行なわれている位置までのオブジェクトコードの
出力を行ない、命令生成処理2105を行なう。命令生
成処理2105では参照中の参照情報中の参照種別に従
い、命令の生成を行ない、コード生成終了判定処理21
01に戻る。終了処理2106ではまだ出力されていな
い中間コード1904中のオブジェクトコードの出力を
行ない、コード生成処理を終了する。
In the object output process 2104, the object code is output up to the position of the symbol reference in the intermediate code 1904 pointed to by the reference information being referred to, and the instruction generation process 2105 is performed. In the instruction generation processing 2105, an instruction is generated according to the reference type in the reference information being referred to, and the code generation end determination processing 21
Return to 01. In the end processing 2106, the object code in the intermediate code 1904 that has not been output is output, and the code generation processing ends.

【0067】[0067]

【発明の効果】以上の説明のとうり、従来の最適化アセ
ンブルのアセンブル処理時間が(構文解析にかかる時
間)+(最適化処理にかかる時間)+(中間言語解析に
かかる時間)であり、本発明による最適化アセンブルの
アセンブル処理時間は(構文解析にかかる時間)+(最
適化処理にかかる時間)+(コード生成処理にかかる時
間)である。
As described above, the assembling time of the conventional optimizing assembling is (the time required for parsing) + (the time required for optimizing) + (the time required for analyzing the intermediate language). The assembling processing time of the optimization assembling according to the present invention is (time required for syntax analysis) + (time required for optimization processing) + (time required for code generation processing).

【0068】中間言語解析がどんな場合でも一行ごとの
処理を行なうことに対して、コード生成処理は参照が行
なわれている箇所のみの解決で済むため、中間言語解析
にかかる時間はコード生成処理にかかる時間より大きく
なり、本発明によるアセンブラの処理方法の方が、短時
間でアセンブルを行なうことができる。この分の時間が
短縮されることによって、実行時間を(1/1.5)か
ら(1/2)倍程度に短縮することができる。
In any case of the intermediate language analysis, the processing for each line is performed, whereas the code generation processing only needs to solve the part where the reference is made. The time is longer than this time, and the assembler processing method according to the present invention can perform assembling in a shorter time. By reducing this time, the execution time can be reduced from (1 / 1.5) to (1/2) times.

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

【図1】本発明の第1の実施例のアセンブラの処理方法
のシステムブロック図である。
FIG. 1 is a system block diagram of an assembler processing method according to a first embodiment of the present invention.

【図2】アセンブラソースを示す図である。FIG. 2 is a diagram showing an assembler source.

【図3】図1に示す本発明のシンボルテーブル、最適化
テーブル、ブロック情報テーブル、参照情報テーブル、
中間コードを示す図である。
FIG. 3 shows a symbol table, an optimization table, a block information table, a reference information table,
FIG. 4 is a diagram showing an intermediate code.

【図4】図1に示す本発明の第1の実施例の構文解析部
の構文解析工程のフローチャートである。
FIG. 4 is a flowchart of a syntax analysis process of a syntax analysis unit according to the first embodiment of the present invention shown in FIG. 1;

【図5】図1に示す本発明の第1の実施例のコード生成
処理部のコード生成処理工程のフローチャートである。
FIG. 5 is a flowchart of a code generation process of a code generation processing unit according to the first embodiment of the present invention shown in FIG. 1;

【図6】アセンブラソースを示す図である。FIG. 6 is a diagram showing an assembler source.

【図7】図1に示す本発明の第1の実施例の最適化処理
が終了したときのシンボルテーブル、最適化テーブル、
ブロック情報テーブル、参照情報テーブル、中間コード
を示す図である。
FIG. 7 is a diagram illustrating a symbol table, an optimization table, and an optimization table when the optimization processing according to the first embodiment of the present invention illustrated in FIG. 1 is completed;
It is a figure showing a block information table, a reference information table, and an intermediate code.

【図8】本発明の第2の実施例のアセンブラの処理方法
のシステムブロック図である。
FIG. 8 is a system block diagram of an assembler processing method according to a second embodiment of the present invention.

【図9】図8に示す本発明の第2の実施例のシンボルテ
ーブル、最適化情報テーブル、参照情報テーブル中間コ
ードを示す図である。
FIG. 9 is a diagram showing a symbol table, an optimization information table, and a reference information table intermediate code according to the second embodiment of the present invention shown in FIG.

【図10】図8に示す本発明の第2の実施例の構文解析
部の構文解析工程のフローチャートである。
FIG. 10 is a flowchart of a syntax analysis step of the syntax analysis unit according to the second embodiment of the present invention shown in FIG. 8;

【図11】図8に示す本発明の第2の実施例のコード生
成処理部のコード生成処理工程のフローチャートであ
る。
FIG. 11 is a flowchart of a code generation process of a code generation processing unit according to the second embodiment of the present invention shown in FIG.

【図12】従来のアセンブラの処理方法のシステムブロ
ック図である。
FIG. 12 is a system block diagram of a conventional assembler processing method.

【図13】従来のアセンブラの処理方法のシンボルテー
ブル、参照情報、中間コードを示す図である。
FIG. 13 is a diagram showing a symbol table, reference information, and an intermediate code in a conventional assembler processing method.

【図14】従来のアセンブラの処理方法の構文解析部の
構文解析工程のフローチャートである。
FIG. 14 is a flowchart of a syntax analysis step of a syntax analysis unit in a conventional assembler processing method.

【図15】従来のアセンブラの処理方法のオペランド決
定処理部のオペランド決定処理工程のフローチャートで
ある。
FIG. 15 is a flowchart of an operand determination processing step of an operand determination processing unit of a conventional assembler processing method.

【図16】従来の第2のアセンブラの処理方法のシステ
ムブロック図である。
FIG. 16 is a system block diagram of a conventional second assembler processing method.

【図17】中間データを示す図である。FIG. 17 is a diagram showing intermediate data.

【図18】従来の第2のアセンブラの処理方法の構文解
析の構文解析工程のフローチャートである。
FIG. 18 is a flowchart of a syntax analysis step of the syntax analysis of the second conventional assembler processing method.

【図19】従来の第2のアセンブラの処理方法の中間デ
ータ解析部の中間データ解析工程のフローチャートであ
る。
FIG. 19 is a flowchart of an intermediate data analysis step of the intermediate data analysis unit in the second conventional assembler processing method.

【図20】アセンブラのソースを示す図である。FIG. 20 is a diagram showing an assembler source.

【図21】中間データを示す図である。FIG. 21 is a diagram showing intermediate data.

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

101 ソースファイル 102 アセンブラ 103 オブジェクトファイル 104 ソースファイル入力部 105 構文解析部 1051 最適化情報生成部 1052 ブロック処理部 106 シンボルテーブル 107 最適化情報テーブル 108 ブロック情報テーブル 109 参照情報テーブル 110 中間コード 111 最適化処理部 112 コード生成処理部 113 オーブジェクトファイル出力部 201 ソースファイル 202 アセンブラ 203 オブジェクトファイル 204 ソースファイル入力部 205 構文解析部 206 シンボルテーブル 207 参照情報テーブル 208 中間コード 209 オペランド決定処理部 210 オブジェクトファイル出力部 301 シンボルテーブル 302 参照情報テーブル 3011〜301n シンボルエントリ 3021〜302k 参照情報エントリ 303 中間コード 401 構文処理 402 前方参照判定処理 403 参照情報生成処理 404 終了判定処理 501 参照情報終了判定処理 502 参照情報決定処理 503 参照位置変更処理 601 ソースファイル 602 アセンブラ 603 オブジェクトファイル 604 ソースファイル入力部 605 構文解析部 6051 最適化情報生成処理 606 シンボルテーブル 607 最適化情報テーブル 608 中間データ 609 最適化処理部 610 中間データ解析部 611 オブジェクトファイル出力部 701 中間データ 7011〜701n トークンエントリ 801 構文処理 802 意味解析処理 803 中間言語データ作成処理 804 終了判定処理 901 構文処理 902 意味解析処理 903 終了判定処理 1101 中間データ 1101〜1104 トークンエントリ 1201〜120(n+1) ブロック 1301 シンボルテーブル 13011〜1301n シンボルエントリ 1302 最適化情報テーブル 13021〜1302m 最適化情報エントリ 1303 ブロック情報テーブル 13031〜1303(m+1) ブロック情報エン
トリ 1304 参照情報テーブル 13041〜1304k 参照情報エントリ 1305 中間コード 1401 構文処理 1402 最適化疑似命令判定処理 1403 最適化情報生成処理 404 セグメント疑煮命令判定処理 1405 ブロック情報生成処理 1406 未定義参照判定処理 1407 参照情報生成処理 1408 終了判定処理 1501 コード生成終了判定処理 1502 参照情報参照位置設定処理 1503 参照情報終了判定処理 1504 参照情報処理 1505 参照情報参照位置変更処理 1506 最適化情報判定処理 1507 最適化情報処理 1508 コード出力処理 1701 シンボルテーブル 17011 シンボルエントリ 1702 最適化情報テーブル 17021 最適化情報エントリ 1703 ブロック情報テーブル 17031〜1703n ブロック情報エントリ 1704 参照情報テーブル 17041 参照情報エントリ 1801 ソースファイル 1802 アセンブラ 1803 オブジェクトファイル 1804 ソースファイル入力部 1805 構文解析部 18051 最適化情報生成部 1806 シンボルテーブル 1807 最適化情報テーブル 1808 参照情報テーブル 1809 中間コード 1810 最適化処理部 1811 コード生成処理部 1812 オブジェクトファイル出力部 1901 シンボルテーブル 19011〜1901n シンボルエントリ 1902 最適化情報テーブル 19021〜1902m 最適化情報エントリ 1903 参照情報テーブル 19031〜1903k 参照情報エントリ 1904 中間コード 2001 構文処理 2002 未定義参照判定処理 2003 最適化疑似命令判定処理 2004 最適化情報生成処理 2005 参照情報生成処理 2006 終了判定処理 2101 コード生成終了判定処理 2102 参照種別判定処理 2103 参照解決処理 2104 オブジェクト出力処理 2105 命令生成処理 2106 終了処理
101 source file 102 assembler 103 object file 104 source file input unit 105 syntax analysis unit 1051 optimization information generation unit 1052 block processing unit 106 symbol table 107 optimization information table 108 block information table 109 reference information table 110 intermediate code 111 optimization processing Part 112 code generation processing part 113 object file output part 201 source file 202 assembler 203 object file 204 source file input part 205 syntax analysis part 206 symbol table 207 reference information table 208 intermediate code 209 operand determination processing part 210 object file output part 301 Symbol table 302 Reference information table 3011 to 301n Symbol entry Birds 3021 to 302k Reference information entry 303 Intermediate code 401 Syntax processing 402 Forward reference determination processing 403 Reference information generation processing 404 End determination processing 501 Reference information end determination processing 502 Reference information determination processing 503 Reference position change processing 601 Source file 602 Assembler 603 Object File 604 Source file input section 605 Syntax analysis section 6051 Optimization information generation processing 606 Symbol table 607 Optimization information table 608 Intermediate data 609 Optimization processing section 610 Intermediate data analysis section 611 Object file output section 701 Intermediate data 7011-701n Token entry 801 syntax processing 802 semantic analysis processing 803 intermediate language data creation processing 804 end determination processing 901 syntax processing 902 semantic analysis processing 9 3 End determination processing 1101 Intermediate data 1101 to 1104 Token entry 1201 to 120 (n + 1) block 1301 Symbol table 13011 to 1301n Symbol entry 1302 Optimization information table 13021 to 1302m Optimization information entry 1303 Block information table 13031 to 1303 (m + 1) block Information entry 1304 Reference information table 13041 to 1304k Reference information entry 1305 Intermediate code 1401 Syntax processing 1402 Optimization pseudo instruction determination processing 1403 Optimization information generation processing 404 Segment boiling instruction determination processing 1405 Block information generation processing 1406 Undefined reference determination processing 1407 Reference information generation processing 1408 End determination processing 1501 Code generation end determination processing 1502 Reference information reference Reference position setting processing 1503 Reference information end determination processing 1504 Reference information processing 1505 Reference information reference position change processing 1506 Optimization information determination processing 1507 Optimization information processing 1508 Code output processing 1701 Symbol table 17011 Symbol entry 1702 Optimization information table 17021 Optimization Information entry 1703 block information table 17031 to 1703n block information entry 1704 reference information table 17041 reference information entry 1801 source file 1802 assembler 1803 object file 1804 source file input unit 1805 syntax analysis unit 18051 optimization information generation unit 1806 symbol table 1807 optimization information Table 1808 Reference information table 1809 Intermediate code 1810 Optimal Processing unit 1811 Code generation processing unit 1812 Object file output unit 1901 Symbol table 19011 to 1901n Symbol entry 1902 Optimization information table 19021 to 1902m Optimization information entry 1903 Reference information table 19031 to 1903k Reference information entry 1904 Intermediate code 2001 Syntax processing 2002 Not yet Definition reference determination processing 2003 Optimization pseudo instruction determination processing 2004 Optimization information generation processing 2005 Reference information generation processing 2006 End determination processing 2101 Code generation end determination processing 2102 Reference type determination processing 2103 Reference resolution processing 2104 Object output processing 2105 Instruction generation processing 2106 End processing

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 9/44,9/45 ──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int.Cl. 7 , DB name) G06F 9/44, 9/45

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 入力データを読み込む工程と、所定の構
文がシンボルテーブルを参照するごとに参照情報を生成
し最適化命令ごとに最適化情報テーブルを生成し前記構
文が最適化疑似命令のときブロック情報を生成し前記
力データから中間コードを作成する構文解析工程と、前
記シンボルテーブルおよび前記最適化情報テーブルのそ
れぞれに対応して前記最適化命令のステップ数を最適化
する最適化処理工程と、前記中間コード中の未決定オペ
ランドの解決を前記ブロック情報が指している前記中間
コードの位置から前記ブロック情報が持っているサイズ
分だけ行うコード生成処理工程と、前記コード生成処理
工程で生成生成されたオブジェクトコードを出力するオ
ブジェクトファイル出力工程とを有することを特徴とす
るアセンブラの処理方法。
1. A a process of reading the input data to generate optimization information table for each product to optimize instruction reference information each time the predetermined syntax refers to the symbol table the structure
And parsing step statement creates an intermediate code from the input <br/> force data to generate block information when optimization directives, the optimization in correspondence with each of the symbol table and the optimization information table An optimization processing step of optimizing the number of steps of the instruction; and the intermediate step in which the block information points to the solution of an undecided operand in the intermediate code.
The size of the block information from the position of the code
Code generation processing performed only for the minutes, and the code generation processing
Output the object code generated in the process
A method of outputting an object file .
【請求項2】 前記構文解析工程は、前記構文がインス
トラクションのとき中間コードの生成を行う構文処理ス
テップと、前記構文が前記最適化疑似命令か否かを判定
する最適化疑似命令判定処理ステップと、前記最適化疑
似命令判定処理ステップで前記構文が前記最適化疑似命
令のとき実行する分岐情報生成処理ステップと、前記構
文がセグメント疑似命令否かを判定するセグメント疑
似命令判定処理ステップと、前記セグメント疑似命令判
定処理ステップで前記構文がセグメント疑似命令のとき
実行するブロック情報生成処理ステップと、前記構文の
前記オペランドに未定義参照シンボルがあるか否かを判
定する未定義参照判定ステップと、前記構文の前記オペ
ランドに未定義参照シンボルがあるとき実行する参照情
報処理ステップとを有することを特徴とする請求項1記
載のアセンブラ処理方法。
2. The syntax analysis step includes: a syntax processing step of generating an intermediate code when the syntax is an instruction; and an optimization pseudo-instruction determination processing step of determining whether the syntax is the optimization pseudo-instruction. and branch information generation processing step of the syntax by the optimization directives determination process step is executed when the optimization directive, and segment directives determination processing step of determining whether the syntax segment directive or the A block pseudo-instruction determining step in which the syntax is executed when the syntax is a segment pseudo-instruction; an undefined reference determining step of determining whether the operand of the syntax includes an undefined reference symbol; A reference information processing step to be executed when there is an undefined reference symbol in the operand of the syntax. 2. The assembler processing method according to claim 1, further comprising:
JP7040214A 1995-02-28 1995-02-28 Assembler processing method Expired - Fee Related JP3000878B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7040214A JP3000878B2 (en) 1995-02-28 1995-02-28 Assembler processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7040214A JP3000878B2 (en) 1995-02-28 1995-02-28 Assembler processing method

Publications (2)

Publication Number Publication Date
JPH08234998A JPH08234998A (en) 1996-09-13
JP3000878B2 true JP3000878B2 (en) 2000-01-17

Family

ID=12574534

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7040214A Expired - Fee Related JP3000878B2 (en) 1995-02-28 1995-02-28 Assembler processing method

Country Status (1)

Country Link
JP (1) JP3000878B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR200457488Y1 (en) * 2009-12-29 2011-12-22 태양당인쇄(주) Packing box for food

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3231619B2 (en) * 1996-04-25 2001-11-26 エヌイーシーマイクロシステム株式会社 Assembling method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01233622A (en) * 1988-03-15 1989-09-19 Kobe Nippon Denki Software Kk Machine language branching instruction generation processing system
JPH02278432A (en) * 1989-04-20 1990-11-14 Nec Corp Optimumizing system for branching instruction
JPH0322031A (en) * 1989-06-19 1991-01-30 Nec Corp Optimizing processing system for branch instruction
JPH03271941A (en) * 1990-03-20 1991-12-03 Fujitsu Ltd Optimizing system for language processor
JPH05257703A (en) * 1991-11-07 1993-10-08 Nec Ic Microcomput Syst Ltd Assembler device
JPH0651993A (en) * 1992-06-05 1994-02-25 Nec Corp Assembler

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR200457488Y1 (en) * 2009-12-29 2011-12-22 태양당인쇄(주) Packing box for food

Also Published As

Publication number Publication date
JPH08234998A (en) 1996-09-13

Similar Documents

Publication Publication Date Title
US7716655B2 (en) Computer system for compiling source program
US20070168984A1 (en) Compiling system, debugging system and program development system
US6243864B1 (en) Compiler for optimizing memory instruction sequences by marking instructions not having multiple memory address paths
US20020143823A1 (en) Conversion system for translating structured documents into multiple target formats
US20090249307A1 (en) Program analysis apparatus, program analysis method, and program storage medium
US20020035580A1 (en) Computer readable medium containing HTML document generation program
US20100199269A1 (en) Program optimization device and program optimization method
US5949993A (en) Method for the generation of ISA simulators and assemblers from a machine description
CN112379917A (en) Browser compatibility improving method, device, equipment and storage medium
US6519768B1 (en) Instruction translation method
JP3909073B2 (en) Compiler and logic circuit design method
JP2879099B1 (en) Abstract syntax tree processing method, computer readable recording medium recording abstract syntax tree processing program, computer readable recording medium recording abstract syntax tree data, and abstract syntax tree processing device
JP3000878B2 (en) Assembler processing method
US20070169054A1 (en) Process of automatically translating a high level programming language into an extended activity diagram
US7127711B2 (en) Forming an executable program
US20030009744A1 (en) Source code line counting system and method
CN111639504A (en) Multi-language translation method, device and equipment for webpage
JP3003459B2 (en) Program creation support device
Guillermo et al. Towards a Faster Incremental Packrat Parser
JP2827979B2 (en) Assembler processing apparatus and assembler processing method
KR100290623B1 (en) A method of controlling data of database
EP1033650A2 (en) Instruction translation method
JP2990882B2 (en) Functional simulation device
JPH08286927A (en) Assembler processing system
KR100277479B1 (en) How to compile a separate fill

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19991012

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

Free format text: PAYMENT UNTIL: 20071112

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20081112

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20081112

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20091112

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20091112

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20101112

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20101112

Year of fee payment: 11

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

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

Free format text: PAYMENT UNTIL: 20101112

Year of fee payment: 11

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20111112

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20111112

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20121112

Year of fee payment: 13

LAPS Cancellation because of no payment of annual fees